msw test breaking
See original GitHub issue@kettanaito, after upgrading msw, we’re getting this test failure:
FAIL src/__tests__/index.js
● Test suite failed to run
Error: Failed to restore patched modules: no patches found. Did you forget to run ".apply()"?
36 |
37 | beforeAll(() => server.listen(backend))
> 38 | afterAll(() => server.close())
| ^
39 | afterEach(() => server.resetHandlers())
40 |
at Object.restore (node_modules/@mswjs/interceptors/src/createInterceptor.ts:83:15)
at Object.close (node_modules/msw/node/lib/index.js:7690:29)
at Object.<anonymous> (src/setup-tests.tsx:38:23)
I’ve dug a little bit but I’m not sure what’s changed and why this is happening. Any ideas?
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
If you fail the exam - Association of Social Work Boards
It breaks down your performance by exam content area and serves as a good resource as you make a study plan. 90-day waiting...
Read more >Phil in the Gaps – Masters and Clinical Social Work Exam Prep
Watch Phil break down questions and provide insight on how to approach the exam. ... Phillip Luttrell is a LMSW-C clinical social worker...
Read more >Social Work Test Prep: LMSW, LCSW, ASWB Exams - Agents ...
Prepare for the ASWB Exam with our free tools, study tips, expert advice, and more. ... test-taking tips, and strategies to break down...
Read more >Secrets for Passing the LMSW Exam - SocialWork.Career
I failed the first time by 4 points and the second time by 1 point. Do you know how frustrating that was for...
Read more >LCSW Practice Exam - Social Work Test Prep
The Licensed Clinical Social Work (LCSW) exam is administered by Association of Social Work Board (ASWB). ... The Clinical exam breaks down this...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I figured it out! Sorry to make you spend time on this. It turns out these tests run the same code that runs when the app starts up and that includes calling
startWorker
🤦 So we were callingcreateInterceptor
twice which I guess is the issue. Here’s the fix: https://github.com/kentcdodds/react-workshop-app/commit/a204e5d453e9180629f527b7fe74cd175626cd83Thanks for your help!
Thanks for looking into it. This should get things reproducing for you: