Unable to run tests with NodeNext #4492
Unanswered
falk-stefan
asked this question in
Q&A
Replies: 1 comment
-
|
The example app is using |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I want to run some unit-tests for my expressjs application.
However, I am not able to run any tests because jest is not able to run because it does not seem to pick up my tsconfig. I'm not 100% sure about that but it looks like that's the case. Using
NodeNextrequires relative imports to come with a suffix.jsfor example:but this will throw:
How can I fix this issue?
jest.config.tstsconfig.json{ "compilerOptions": { "target": "es2022", "module": "NodeNext", "moduleResolution": "NodeNext", "rootDir": "./src", "sourceMap": true, "outDir": "./dist", "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "strict": true, "noImplicitAny": false, "skipLibCheck": true, "allowJs": true, "checkJs": false, "experimentalDecorators": true }, "include": [ "src/**/*.ts", "src/**/*.js" ], "exclude": [ "node_modules" ] }Beta Was this translation helpful? Give feedback.
All reactions