Missing instructions on how to use v3 with Jest and ts-node
See original GitHub issueReproduction
Well, just update the lib for a project that used Jest and ts-node.
Somewhat weird error messages start to appear in the output when running the tests: SyntaxError: Cannot use import statement outside a module
Expected behavior
The library would work like before. Another option is to add instructions about how to configure the library with a standard NodeJs environment that uses Jest and TypeScript.
Screenshots
Your Environment
software | version |
---|---|
node-fetch | 3 |
node | 14 |
npm | 6 |
Operating System | macOS |
Additional context
Issue Analytics
- State:
- Created 2 years ago
- Reactions:30
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Jest Typescript with ES Module in node_modules error
You don't have a tsconfig.json file that specifies module . Therefore it uses the default, where it transpiles all your modules to CommonJS ......
Read more >ts-jest - npm
These instructions will get you setup to use ts-jest in your project. For more detailed documentation, please check online documentation. using ...
Read more >Configuring Jest
You can use --config flag to pass an explicit path to the file. ... To read TypeScript configuration files Jest requires ts-node ....
Read more >TypeScript - Cypress Documentation
Type "restart ts" and select the "TypeScript: Restart TS server." option. If that does not work, try restarting the IDE. Types for Custom...
Read more >Jest | IntelliJ IDEA Documentation - JetBrains
Alternatively, select a test file in the Project tool window and select Create <filename> from the context menu. Specify the Node.js interpreter ...
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 FreeTop 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
Top GitHub Comments
I will probably stay on node-fetch@2 in my Typescript project for now.
@LinusU If I read that right it seems to be an experimental feature that is likely going to have breaking changes. That does not sound like something that we should include in a production code base.