Skip to content

Commit

Permalink
Install and utilize whatwg-fetch for Polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
Bennett Dams committed Oct 20, 2021
1 parent 3973836 commit 5cbe84a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@
`npm install msw --save-dev`

3. Integrate MSW with Jest

3. Install and utilize `whatwg-fetch` - needed for Polyfill with Next.js
`npm install -D whatwg-fetch`
4 changes: 3 additions & 1 deletion jest.setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ beforeAll(() => server.listen())
// so they don't affect other tests.
afterEach(() => server.resetHandlers())
// Clean up after the tests are finished.
afterAll(() => server.close())
afterAll(() => server.close())

import "whatwg-fetch"
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"jest": "^27.3.1",
"msw": "^0.35.0",
"react-test-renderer": "^17.0.2",
"typescript": "4.4.4"
"typescript": "4.4.4",
"whatwg-fetch": "^3.6.2"
}
}

0 comments on commit 5cbe84a

Please sign in to comment.