question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 2 years ago
  • Reactions:19
  • Comments:17

github_iconTop GitHub Comments

11reactions
ahnpnlcommented, May 30, 2021

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 with ts-jest 26, Jest 27 with ts-jest 27

11reactions
ahnpnlcommented, May 25, 2021

27.0.0 was out

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found