Options for configuring typechecking test environment.
boolean
false
--typecheck, --typecheck.enabled
Enable typechecking alongside your regular tests.
boolean
false
--typecheck.only
Run only typecheck tests, when typechecking is enabled. When using CLI, this option will automatically enable typechecking.
'tsc' | 'vue-tsc' | string
tsc
What tools to use for type checking. Vitest will spawn a process with certain parameters for easier parsing, depending on the type. Checker should implement the same output format as tsc.
You need to have a package installed to use typechecker:
tsc requires typescript packagevue-tsc requires vue-tsc packageYou can also pass down a path to custom binary or command name that produces the same output as tsc --noEmit --pretty false.
string[]
['**/*.{test,spec}-d.?(c|m)[jt]s?(x)']
Glob pattern for files that should be treated as test files
string[]
['**/node_modules/**', '**/dist/**', '**/cypress/**', '**/.{idea,git,cache,output,temp}/**']
Glob pattern for files that should not be treated as test files
boolean
false
Check JS files that have @ts-check comment. If you have it enabled in tsconfig, this will not overwrite it.
boolean
false
Do not fail, if Vitest found errors outside the test files. This will not show you non-test errors at all.
By default, if Vitest finds source error, it will fail test suite.
string
Path to custom tsconfig, relative to the project root.
number
10_000
Minimum time in milliseconds it takes to spawn the typechecker.
© 2021-Present VoidZero Inc. and Vitest contributors
Licensed under the MIT License.
https://vitest.dev/config/typecheck