new·Earn with mozg — 20% of every monthSend somebody here and take a fifth of every plan payment they make, for as long as they keep paying — not a bounty on the first invoice. Your handle is the link, the window is thirty days, and the commission lands on your balance the second they pay. Free to join: if you have signed in, you already have the link. mozg.sh/earnall news →
mozg.beta
Sign in

Vitest · Config reference · all subjects

config fundamentals

8 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

CLI generated documentation source

The file docs/guide/cli-generated.md is generated from packages/vitest/src/node/cli/cli-config.ts. Regenerate it with pnpm -C docs run cli-table and commit the result.

Config pages frontmatter and format

Config pages use frontmatter with title: <name> | Config and outline: deep. Include a list with - **Type:** / - **Default:** / - **CLI:** entries for each configuration option.

Version and experimental API markup

Mark the version an API appeared in with <Version>X.Y.Z</Version> in the heading plus an explicit {#anchor}. Experimental APIs use <Version type="experimental">X.Y.Z</Version> with <Experimental />. Deprecated APIs use <Deprecated />.

Dead internal links fail documentation build

Dead internal links fail the build. Every CLI option gets a generated link to /config/<option>, so a new option needs a matching docs/config/<option>.md page or an entry in skipConfig in docs/.vitepress/scripts/cli-generator.ts.

Type-checked code samples in documentation

Code blocks tagged ts twoslash are type-checked during pnpm docs:build only; the dev server skips twoslash and will not catch broken samples. A sample that intentionally fails needs // @errors: <code>. Use // ---cut--- and // @filename: to hide setup lines. Changing public types in packages/ can break twoslash samples.

Documentation sidebar configuration

New docs pages are not auto-discovered and must be manually added to a sidebar entry in docs/.vitepress/config.ts. The /config, /guide, and /api sidebars are hand-maintained arrays.

Local documentation development

Run pnpm docs from the repo root to start a local dev server for the VitePress docs site in docs/.

Building documentation with environment setup

Build documentation with pnpm docs:build from the repo root; it sets the required env vars and regenerates the CLI table first. Run pnpm build at the repo root first since the build type-checks code samples against the built workspace packages.

Give your agent this brain