···14141515Under the hood Vitest calls `tsc` or `vue-tsc`, depending on your config, and parses results. Vitest will also print out type errors in your source code, if it finds any. You can disable it with [`typecheck.ignoreSourceErrors`](/config/#typecheck-ignoresourceerrors) config option.
16161717-Keep in mind that Vitest doesn't run or compile these files, they are only statically analyzed by the compiler, and because of that you cannot use any dynamic statements. Meaning, you cannot use dynamic test names, and `test.each`, `test.runIf`, `test.skipIf`, `test.concurrent` APIs. But you can use other APIs, like `test`, `describe`, `.only`, `.skip` and `.todo`.
1717+Keep in mind that Vitest doesn't run these files, they are only statically analyzed by the compiler. Meaning, that if you use a dynamic name or `test.each` or `test.for`, the test name will not be evaluated - it will be displayed as is.
1818+1919+::: warning
2020+Before Vitest 2.1, your `typecheck.include` overrode the `include` pattern, so your runtime tests did not actually run; they were only type-checked.
2121+2222+Since Vitest 2.1, if your `include` and `typecheck.include` overlap, Vitest will report type tests and runtime tests as separate entries.
2323+:::
18241925Using CLI flags, like `--allowOnly` and `-t` are also supported for type checking.
2026
···11import * as nodeos from 'node:os'
22import crypto from 'node:crypto'
33import { relative } from 'pathe'
44-import type { BrowserProvider, ProcessPool, Vitest, WorkspaceProject } from 'vitest/node'
44+import type { BrowserProvider, ProcessPool, Vitest, WorkspaceProject, WorkspaceSpec } from 'vitest/node'
55import { createDebugger } from 'vitest/node'
6677const debug = createDebugger('vitest:browser:pool')
···9292 await Promise.all(promises)
9393 }
94949595- const runWorkspaceTests = async (method: 'run' | 'collect', specs: [WorkspaceProject, string][]) => {
9595+ const runWorkspaceTests = async (method: 'run' | 'collect', specs: WorkspaceSpec[]) => {
9696 const groupedFiles = new Map<WorkspaceProject, string[]>()
9797 for (const [project, file] of specs) {
9898 const files = groupedFiles.get(project) || []
+1-1
packages/browser/src/node/serverTester.ts
···2222 const { contextId, testFile } = server.resolveTesterUrl(url.pathname)
2323 const project = server.project
2424 const state = server.state
2525- const testFiles = await project.globTestFiles()
2525+ const { testFiles } = await project.globTestFiles()
2626 // if decoded test file is "__vitest_all__" or not in the list of known files, run all tests
2727 const tests
2828 = testFile === '__vitest_all__'
···33import { dirname, relative, resolve } from 'pathe'
44import { mergeConfig } from 'vite'
55import fg from 'fast-glob'
66-import type { UserWorkspaceConfig, WorkspaceProjectConfiguration } from '../../public/config'
76import type { Vitest } from '../core'
88-import type { UserConfig } from '../types/config'
77+import type { UserConfig, UserWorkspaceConfig, WorkspaceProjectConfiguration } from '../types/config'
98import type { WorkspaceProject } from '../workspace'
109import { initializeProject } from '../workspace'
1110import { configFiles as defaultConfigFiles } from '../../constants'