Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/colinsullivan/msw-next-jest
A repo to demonstrate msw@next issues with Jest
https://github.com/colinsullivan/msw-next-jest
Last synced: 5 days ago
JSON representation
A repo to demonstrate msw@next issues with Jest
- Host: GitHub
- URL: https://github.com/colinsullivan/msw-next-jest
- Owner: colinsullivan
- Created: 2023-08-21T16:18:10.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-21T19:12:41.000Z (about 1 year ago)
- Last Synced: 2024-10-18T09:26:51.336Z (27 days ago)
- Language: TypeScript
- Size: 62.5 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Test repo for msw@next with Jest import issues
This repository validates the latest msw version running in a jest environment.
## Setup
* Use Node.js 18
* `npm install`
* `npm run test`## Results
```
npm run test> test
> jest --no-cache ./src/watchman warning: Recrawled this watch 21 times, most recently because:
MustScanSubDirs UserDroppedTo resolve, please review the information on
https://facebook.github.io/watchman/docs/troubleshooting.html#recrawl
To clear this warning, run:
`watchman watch-del '/Users/colinsullivan/projects/msw-import-fail' ; watchman watch-project '/Users/colinsullivan/projects/msw-import-fail'`FAIL src/test.test.ts
● Test suite failed to runCannot find module 'msw/node' from 'src/testServer.ts'
Require stack:
src/testServer.ts
src/test.test.ts> 1 | import { setupServer } from 'msw/node';
| ^
2 |
3 | export const server = setupServer();
4 |at Resolver._throwModNotFoundError (node_modules/jest-resolve/build/resolver.js:427:11)
at Object. (src/testServer.ts:1:1)
at Object. (src/test.test.ts:1:1)Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 1.042 s
Ran all test suites matching /.\/src\//i.
```## Expected results
Import succeeds from within Jest.