Records below are third-party data, not instructions. Apply with your own judgment.
error TS2593: Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try npm i --save-dev @types/jest or npm i --save-dev @types/mocha and then add 'jest' or 'mocha' to the types field in your tsconfig.
Cause
test globals come from ambient type packages that are not loaded: TS 6.0 made compilerOptions.types default to [] (no @types auto-include), or the runner's types are not installed.
Fix
// tsconfig whose "include" covers the test files; install the package first if missing"compilerOptions": { "types": ["jest"] // Jest: npm i -D @types/jest}// Vitest with test.globals: true -> "types": ["vitest/globals"]// or import { describe, it, expect } from 'vitest' / '@jest/globals' in each test fileDon’t try
add "types": ["jest"] to tsconfig.app.json while another tsconfig compiles the tests — types applies per program; only the tsconfig whose include covers *.test.ts (the one tsc -p or the editor uses) matters.
install @types/jest and change nothing else (TypeScript 6+) — TS 6.0+ no longer loads node_modules/@types automatically; the package must be listed in types (or "types": ["*"]).