Skip to content

Vitest test-declaration surface

What VitestDedup recognizes, and why. This is the reference the extractor is written against: anything Vitest can express that the analyzer must either read or refuse.

Verified against the Vitest API and config documentation at version 5.0.0. Facts that are v5 breaking changes relative to v2-v4, the versions most repositories still run, are flagged [v5 CHANGE]. Anything not confirmed by the published docs is marked UNVERIFIED.

Start with Extraction hazards, ranked if you are reading this to understand where static analysis of Vitest gets hard. The numbered sections are the surface itself; code comments and fixtures cite them by number.

# Section Page
1 Test-declaring callables: test, it, describe, suite, bench Declarations
2 Modifiers and chained forms: .skip, .only, .todo, .each, chaining order Declarations
3 Signature variants: options object vs bare function, legacy timeout Declarations
4 .each / .for table forms .each and .for tables
4b Title directives, numeric coercion, truncation Title formatting
5 Lifecycle hooks and their scoping Hooks
6 test.extend and fixture resolution Fixtures
7 Imports vs globals: true How the API becomes available
8 import.meta.vitest In-source testing
9 include, exclude, benchmark and typecheck channels Default file globs and projects
10 Per-project resolution Default file globs and projects
11 Playwright, Jest, Cypress, Mocha, node:test Look-alikes
12 mock, doMock, hoisted and the rest of vi Module mocking
12b Module-scope ambient state: timers, env, spies, expect.extend Ambient state
Ranked list of what makes extraction hard Extraction hazards