jest-browser-resolver
v1.0.0
Published
Jest + jsdom acts like a browser (i.e., it looks for "browser" imports under pkg.exports), but msw knows that you're operating in a Node environment:
Downloads
25
Readme
Jest + jsdom acts like a browser (i.e., it looks for "browser" imports under pkg.exports), but msw knows that you're operating in a Node environment:
https://github.com/mswjs/msw/issues/1786#issuecomment-1782559851
The MSW project's recommended workaround is to disable Jest's customExportConditions completely, so no packages use their browser's versions.
We'll instead clear export conditions only for MSW:
// in jest.config.js
const jestBrowserResolver = require('jest-browser-resolver')
module.exports = {
// ...
// other jest config
// ...
resolver: 'jest-browser-resolver'
}