Skip to content

Commit

Permalink
Start to use msw to mock server requests.
Browse files Browse the repository at this point in the history
So far have had to stop jsdom declaring that tests are running in a browser:

mswjs/msw#1786

Fiddle with whatwg-fetch polyfill:

reduxjs/redux-toolkit#1271

Still more things to fix, some presumably a consequence of first issue.
  • Loading branch information
jg210 committed Feb 8, 2024
1 parent b8e704b commit 53d10fd
Show file tree
Hide file tree
Showing 5 changed files with 745 additions and 18 deletions.
7 changes: 6 additions & 1 deletion src/frontend/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ export default {
'\\.(css|less)$': 'identity-obj-proxy',
},
setupFilesAfterEnv: [
"@testing-library/jest-dom",
"<rootDir>/setup-jest.ts"
]
],
testEnvironmentOptions: {
// https://github.com/mswjs/msw/issues/1786
customExportConditions: [''],
}
};
Loading

0 comments on commit 53d10fd

Please sign in to comment.