Running Type Checks in Vitest

From the Vitest cheat sheet · Type Testing · verified Nov 2026

Running Type Checks

Enable typecheck mode so type tests and type errors show up in the run

typescript
// vitest --typecheck            runs tests and type tests
// vitest run --typecheck.only   only *.test-d.ts files

export default defineConfig({
  test: {
    typecheck: { enabled: true },
  },
})
📌 Vitest runs tsc --noEmit (or vue-tsc) and maps errors to tests
💡 Source type errors are reported too; ignoreSourceErrors hides them
⚡ --typecheck.only can replace a separate tsc step in CI
⚠️ Dynamic names from test.each aren't evaluated in type tests
typechecktsc

Continue with Vitest

Save the full cheat sheet or work through every related task.

More Vitest tasks

Back to the full Vitest cheat sheet