I see a test that has a jest.mock call outside of a describe block.
I am concerned this will create a change visible outside of the test. I do not want this test affecting other tests.
Should jest.mock be moved inside the describe block or is it OK as-is?
import target from '../';
jest.mock('../../../helpers/helpers.api', () => ({
httpPost(...args) {
return args;
}
}));
describe('my component', () => {
it('should foo', () => {
//...
});
});
Aucun commentaire:
Enregistrer un commentaire