-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Copy link
Labels
feat: typecheckIssues and PRs related to typechecking featureIssues and PRs related to typechecking featurep3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)
Description
Describe the bug
I have Vitest configured like this to enable type checking:
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
silent: true,
typecheck: {
enabled: true,
tsconfig: "./tsconfig.test.json",
include: ["**/test/*.test.ts"],
},
},
});The TS config for .test.ts files is the following:
{
"extends": "./tsconfig.json",
"compilerOptions": {
"noEmit": true,
"types": ["node", "vitest/globals"]
},
"include": ["packages/*/test/**/*", "packages/*/src/**/*"],
"exclude": ["node_modules", "**/dist"]
}The basic tsconfig.json file is the following:
{
"compilerOptions": {
"esModuleInterop": true,
"skipLibCheck": true,
"target": "ES2023",
"resolveJsonModule": true,
"moduleDetection": "force",
"isolatedModules": true,
"verbatimModuleSyntax": true,
"erasableSyntaxOnly": true,
"strict": true,
"noUncheckedIndexedAccess": true,
"noImplicitOverride": true,
"module": "NodeNext",
"sourceMap": true,
"declaration": true,
"declarationMap": true
},
"exclude": ["**/dist", "**/bin/**/*", "**/test", "**/vitest.config.*", "node_modules"]
}When running Vitest in watch mode, the timer displayed in the “Duration” line of the CLI output does not stop once the tests are run, particularly when any test files are changed.
Such a bug did not happen in Vitest 3 with the settings above.
Such a bug does not happen in Vitest 4 when type checking is disabled (no typecheck property provided) or when Vitest is not run in watch mode.
Reproduction
System Info
System:
OS: macOS 15.7.1
CPU: (8) arm64 Apple M2
Memory: 135.48 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.21.0 - /Users/webdevbynight/.nvm/versions/node/v22.21.0/bin/node
npm: 10.9.4 - /Users/webdevbynight/.nvm/versions/node/v22.21.0/bin/npm
pnpm: 10.19.0 - /Users/webdevbynight/Library/pnpm/pnpm
bun: 1.1.38 - /Users/webdevbynight/.bun/bin/bun
Browsers:
Chrome: 141.0.7390.123
Firefox: 144.0
Safari: 26.0.1
npmPackages:
vitest: 4.0.3 => 4.0.3Used Package Manager
pnpm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feat: typecheckIssues and PRs related to typechecking featureIssues and PRs related to typechecking featurep3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)