kentcdodds/testing-react-apps

Obsolete information about `jest.config.js`

vasilii-kovalev opened this issue · 3 comments

In Context and Custom Render Method, App Test Utils, Extra Credit Solution 3 video and here there are some references to jest.config.js and whatwg-fetch package.

Because window.fetch isn't supported in JSDOM/Node, we have installed the whatwg-fetch module which will polyfill fetch in our testing environment which will allow MSW to handle those requests for us. This is setup automatically in our jest.config.js file.

As I can see, there is no jest.config.js file in the project. I suppose it was replaced by src/setupTests.js. And whatwg-fetch exists only in package-lock.json (as a react-app-polyfill's dependency), so we can hardly say that "we have installed" the module.

Maybe this paragraph should be removed or at least re-written/updated.

I think I've resolved this as much as we can for now. Thanks!