You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/home/user/project/node_modules/@jest/environment/build/index.d.ts:401:26
Error: Interface 'JestImportMeta' incorrectly extends interface 'ImportMeta'.
The types of 'jest.doMock' are incompatible between these types.
Type '<T = unknown>(moduleName: string, moduleFactory?: (() => T) | undefined, options?: { virtual?: boolean; } | undefined) => Jest' is not assignable to type '<T = unknown>(moduleName: string, factory?: (() => T) | undefined, options?: MockOptions | undefined) => typeof jest'.
Types of parameters 'options' and 'options' are incompatible.
Type 'MockOptions | undefined' is not assignable to type '{ virtual?: boolean; } | undefined'.
Type 'MockOptions' is not assignable to type '{ virtual?: boolean; }' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
Types of property 'virtual' are incompatible.
Type 'boolean | undefined' is not assignable to type 'boolean'.
Type 'undefined' is not assignable to type 'boolean'.
export declare interface JestImportMeta extends ImportMeta {
jest: Jest;
Hi @mrazauskas , thanks for the quick response (although it seems you were aware of this even before my report :)) - I can confirm that updating @types/jest fixes the issue for me, thanks!
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
Version
29.7.0
Steps to reproduce
@jest/environment
exactOptionalPropertyTypes
in your tsconfigSee skaut/shared-drive-mover#1741
Expected behavior
No error
Actual behavior
Additional context
No response
Environment
System: OS: Linux 6.5 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish) CPU: (12) x64 12th Gen Intel(R) Core(TM) i7-1265U Binaries: Node: 22.8.0 - /usr/bin/node Yarn: 1.22.21 - /usr/bin/yarn npm: 10.8.3 - /usr/bin/npm pnpm: 8.14.3 - /usr/bin/pnpm npmPackages: jest: ^29.7.0 => 29.7.0
The text was updated successfully, but these errors were encountered: