Open mickael-h opened 1 year ago
FWIW:
I had a similar issue and I had to add the include vitest/globals
as part of the compilerOptions.types
.
Here's my tsconfig.json
.
{
"compilerOptions": {
"target": "esnext",
"useDefineForClassFields": true,
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": false,
"skipLibCheck": true,
"esModuleInterop": false,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"baseUrl": "src",
"types": [
"vitest/globals",
"vite/client",
"node",
"@testing-library/jest-dom"
]
},
"include": ["src"]
}
Hope it's helpful :)
@testing-library/jest-dom
version: 6.1.3node
version: 18.0.0jest
(orvitest
) version: 29.6.2npm
(oryarn
) version: 9.5.1react-testing-library
version: 14.0.0Relevant code or config:
tsconfig.json (for NextJS project):
What you did:
We updated jest-dom to v6 from v5. Then we run
tsc --pretty --noEmit
.What happened:
All test statements were no longer recognized:
I really don't have the time to make a new repo with minimal repro steps, but I hope the information I gave will suffice.