Jest 27 support
See original GitHub issueDescribe the bug I am trying to use jest-playwright with Jest 27 and get this error:
TypeError: virtualMocks.get is not a function
at Resolver._getVirtualMockPath (../../node_modules/jest-resolve/build/index.js:447:25)
To Reproduce I am using a standard installation and a single simple test that just opens a browser.
Desktop (please complete the following information):
- OS: [macOS M1]
- Playwright version [1.10.0]
- jest-playwright version [1.5.1]
- jest version [27.0.0-next.7]
Jest configuration (Either in the package.json > jest or in the jest.config.js
):
module.exports = {
globals: {
"ts-jest": {
diagnostics: false,
isolatedModules: true,
},
},
moduleDirectories: ["<rootDir>/../../node_modules"],
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
moduleNameMapper: {
"\\.css$": "identity-obj-proxy",
"\\.scss$": "identity-obj-proxy",
"^@cling/(.*)$": "<rootDir>/../$1",
},
reporters: ["default"],
setupFilesAfterEnv: ["<rootDir>/../lib.shared.test/jest_setup.ts"],
snapshotSerializers: [],
preset: "jest-playwright-preset",
testMatch: ["<rootDir>/__tests__/**/*.spec.ts?(x)"],
transform: {"^.+\\.tsx?$": "ts-jest"},
}
This is a sub-project in a monorepo. But even if I use jest-playwright-preset
in the main configuration it won’t work.
Additional context All’s working fine with Jest 26.6.3
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Jest 27: New Defaults for Jest, 2021 edition
We dropped support for Node 13—but Jest always supports the Current and all LTS Node versions, and Jest 27 continues to support Node...
Read more >Add support for Jest 27 · Issue #2611 · kulshekhar/ts-jest
Upgrading to Jest 27 leads to the following error: TypeError: Jest: a transform must export something. Also the peer dependency scope should be ......
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 - npm
Delightful JavaScript Testing.. Latest version: 29.3.1, last published: 2 months ago. Start using jest in your project by running `npm i ...
Read more >Jest v27 support
Jest v27 support. 26 May 2021 1 min read. The next major version of Jest was released on May 25, 2021 . 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 Free
Top 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
I just ran into this in my project that uses a monorepo. The root issue ended up being an indirect dependency on Jest v26 through
react-scripts
. No idea why! ¯\(ツ)/¯ I resolved the issue by specifying a resolution with yarn to the same one I was already depending on. E.g.:Be sure to clear out your
node_modules
and reinstall after doing so!what was the resolution of this issue?