Add support for Jest 27
See original GitHub issue🐛 Bug Report
Upgrading to Jest 27 leads to the following error:
TypeError: Jest: a transform must export something.
Also the peer dependency scope should be updated alongside this fix:
warning " > ts-jest@26.5.6" has incorrect peer dependency "jest@>=26 <27".
To Reproduce
Upgrade from Jest 26 to Jest 27.
Expected behavior
Running the jest
command to successfully run tests.
Debug log:
# content of ts-jest.log :
{"context":{"allowJs":false,"logLevel":20,"namespace":"jest-preset","package":"ts-jest","version":"26.5.6"},"message":"creating jest presets not handling JavaScript files","sequence":1,"time":"2021-05-25T10:57:05.252Z"}
{"context":{"allowJs":false,"logLevel":20,"namespace":"jest-preset","package":"ts-jest","version":"26.5.6"},"message":"creating jest presets not handling JavaScript files","sequence":2,"time":"2021-05-25T10:57:05.265Z"}
{"context":{"logLevel":20,"namespace":"Importer","package":"ts-jest","version":"26.5.6"},"message":"creating Importer singleton","sequence":3,"time":"2021-05-25T10:57:05.980Z"}
envinfo
System:
OS: Windows 10
Node version: 15.12.0
Npm packages:
"jest": "^27.0.1",
"ts-jest": "^26.5.6",
"typescript": "^4.2.4"
Issue Analytics
- State:
- Created 2 years ago
- Reactions:19
- Comments:17
Top Results From Across the Web
Jest 27: New Defaults for Jest, 2021 edition
Everyone on the new defaults can benefit from a smaller install size, while people needing these packages can still install them separately.
Read more >Stencil: Jest 27 Upgrade Instructions - Ionic Blog
Stencil v2.13.0 includes support for Jest v27, but does not require any project to upgrade their version of Jest at this time. You...
Read more >jest-27-expect-message - npm
Add custom message to Jest expects (with support for Jest 27+). This is a drop in replacement for jest-expect-message .
Read more >react-scripts jest 27 version dependency error - Stack Overflow
I wanted to start testing my React component with frameworks jest and enzyme. I'm writing a code with Typescript.
Read more >Jest Runner | Stryker Mutator
Install @stryker-mutator/jest-runner locally within your project folder, ... For the minimum supported versions, see the peerDependencies section in the ...
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
You are using Jest 26 with
ts-jest
27, which is not a valid combination, see https://github.com/sauldeleon/monorepo-starter/blob/623bc73b10f1a33f3f73695d96cf8c473c7aaedc/yarn.lock#L1744.ts-jest
major version always follows Jest major version. For example: Jest 26 withts-jest
26, Jest 27 withts-jest
2727.0.0 was out