`@types/jest` dependency should be changed to `@jest/types`
See original GitHub issue@testing-library/jest-dom
version: 5.14.1@types/testing-library__jest-dom
version: 5.14node
version: 14npm
(oryarn
) version: yarn 1.2
Problem description:
Looks like Jest v27 types are not supported by @types/jest
and were moved to @jest/types
.
Suggested solution:
Should @types/testing-library__jest-dom
also consider upgrading this dependency?
As I can see @jest/types
do support jest < 27. Seems like a safe upgrade.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:7 (2 by maintainers)
Top Results From Across the Web
types/jest
Start using @types/jest in your project by running `npm i @types/jest`. ... Dependencies: @types/expect, @types/pretty-format ...
Read more >Will there be a @types/jest version 27?
Yes, DefinitelyTyped is not related to Jest. Actually DefinitelyTyped is maintained by folks of the TypeScript team at Microsoft and of course ...
Read more >Configuring Jest
The directory where Jest should store its cached dependency ... A list of reporter names that Jest uses when writing coverage reports.
Read more >@jest/types | Yarn - Package Manager
If you are looking for types of Jest globals, you can import them from @jest/globals package: import {describe, expect, it} from '@jest/globals'; describe('my ......
Read more >Testing constructs - AWS Cloud Development Kit ...
There are two categories of tests that you can write for AWS CDK apps. ... cdk init --language=typescript npm install --save-dev jest @types/jest....
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
We’ve also recently encountered typing issues due to the conflict of Jest 28 vs. the
@types/jest
things that are referenced from@testing-library/jest-dom
. Especially with the issue that themocked
helper previously ints-jest/utils
was moved tojest
directly. Jest states to useimport { jest } from '@jest/globals';
- however, this will then breakjest.mock
usage somehow (not sure why).To work around this I’m using a
jest.ts
that get’s included with the following namespace augmentation:Maybe this helps someone…
+1. Looks like
@types/testing-library__jest-dom
depends onpretty-format@26.6.2
and ifjest
is upgraded to v27, the two different version ofpretty-format
is causing problem possibly becausepretty-format@27.0.6
exports a different value