mswjs / examples

Examples of Mock Service Worker usage with various frameworks and libraries.
685 stars 211 forks source link

Separate with-jest and with-jest-and-jsdom examples #99

Closed VanTanev closed 10 months ago

VanTanev commented 10 months ago

Running MSW 2.0 on Jest when JSDOM is not used allows us to skip patching undici. For that reason, we should show separate examples of setting up MSW on Jest with and without JSDOM

kettanaito commented 10 months ago

Completely agree! Thank you for opening a pull request to address this. Jest indeed works great with MSW when running tests in Node.js because it remaps all the globals, preserving them.