Closed raelgc closed 3 years ago
Locally, my version of npm
is 6.13.4
.
Ok, as I have no idea why a component test was firing a network error on shippable, I added a mock and it worked:
import axios from 'axios';
// other imports here
jest.mock('axios');
const children = [<span key={1}>Lorem ipsum dolor sit amet</span>];
describe('Components / ContentReadMore', () => {
it('displays children', () => {
axios.get.mockResolvedValue({ data: 'foo' });
const { baseElement } = render(
<ContentReadMore>
{children}
</ContentReadMore>
);
const node = baseElement.querySelector('.content-read-more');
expect(node.children.length).toBe(children.length);
});
});
Link to the build failure: https://app.shippable.com/github/arizonabay/output/runs/25835/1/console
Scripts called from the yml (optional):
npm test -- -u
When I run my npm tests locally (with
npm test -- -u
) on my Ubuntu box, all the tests are green.On shippable, they're failing due a network error. But what is odd is the failing tests is just a react component without any network request:
The component is a simple render: