# Extension points — vitest-dev/vitest

> Canonical page: https://codevetter.com/unpack/vitest/extension-points

# Extension points — vitest-dev/vitest

Scanned commit 4ee66c021e0592c886dbab727f0f8da9366f99ab (2026-10-02). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

Extension contracts span Vite plugins, runners, worker factories, environments, coverage providers, reporters, and browser commands. Most are configuration-selected and resolved before or during execution. Coordinator and worker hooks occupy different runtime boundaries, so extensions must preserve serialization and lifecycle rules. Snapshot customization additionally separates matching from storage.
- configureVitest receives project, vitest, injectTestProjects, and defineCacheKeyGenerator; it runs before reporter initialization, and resolved configuration mutations are not automatically re-resolved. — [packages/vitest/src/node/types/plugin.ts#L6-24](https://github.com/vitest-dev/vitest/blob/4ee66c021e0592c886dbab727f0f8da9366f99ab/packages/vitest/src/node/types/plugin.ts#L6-L24) [packages/vitest/src/node/core.ts#L391-400](https://github.com/vitest-dev/vitest/blob/4ee66c021e0592c886dbab727f0f8da9366f99ab/packages/vitest/src/node/core.ts#L391-L400) [docs/api/advanced/plugin.md#L60-84](https://github.com/vitest-dev/vitest/blob/4ee66c021e0592c886dbab727f0f8da9366f99ab/docs/api/advanced/plugin.md#L60-L84)
- config.runner selects a default-exported runner constructor; resolveTestRunner requires importFile, injects moduleRunner, loads serializers/diff options, and wraps callbacks to preserve Vitest RPC reporting. — [packages/vitest/src/runtime/runners/index.ts#L11-67](https://github.com/vitest-dev/vitest/blob/4ee66c021e0592c886dbab727f0f8da9366f99ab/packages/vitest/src/runtime/runners/index.ts#L11-L67) [docs/api/advanced/runner.md#L7-18](https://github.com/vitest-dev/vitest/blob/4ee66c021e0592c886dbab727f0f8da9366f99ab/docs/api/advanced/runner.md#L7-L18)
- Custom worker execution plugs into project.config.poolRunner through a matching name and createPoolWorker(options), after built-in worker choices are exhausted. — [packages/vitest/src/node/pools/pool.ts#L265-287](https://github.com/vitest-dev/vitest/blob/4ee66c021e0592c886dbab727f0f8da9366f99ab/packages/vitest/src/node/pools/pool.ts#L265-L287)
- Custom environments resolve from a path or vitest-environment-{name}; loading branches between native and Vite module runners and validates the default export and supplied transformMode. — [packages/vitest/src/integrations/env/loader.ts#L76-96](https://github.com/vitest-dev/vitest/blob/4ee66c021e0592c886dbab727f0f8da9366f99ab/packages/vitest/src/integrations/env/loader.ts#L76-L96) [packages/vitest/src/integrations/env/loader.ts#L108-138](https://github.com/vitest-dev/vitest/blob/4ee66c021e0592c886dbab727f0f8da9366f99ab/packages/vitest/src/integrations/env/loader.ts#L108-L138)
- Coverage extension modules supply getProvider and optional start/take/stopCoverage hooks; customProviderModule loads through the supplied loader and must provide a default export. — [packages/vitest/src/utils/coverage.ts#L17-45](https://github.com/vitest-dev/vitest/blob/4ee66c021e0592c886dbab727f0f8da9366f99ab/packages/vitest/src/utils/coverage.ts#L17-L45) [packages/vitest/src/utils/coverage.ts#L81-98](https://github.com/vitest-dev/vitest/blob/4ee66c021e0592c886dbab727f0f8da9366f99ab/packages/vitest/src/utils/coverage.ts#L81-L98) [packages/vitest/src/node/coverage.ts#L67-77](https://github.com/vitest-dev/vitest/blob/4ee66c021e0592c886dbab727f0f8da9366f99ab/packages/vitest/src/node/coverage.ts#L67-L77)
- Browser commands extend a built-in registry through config.browser.commands with identifier validation; triggerCommand prefers project commands, then parent commands, and rejects unsupported names. — [packages/browser/src/node/projectParent.ts#L110-121](https://github.com/vitest-dev/vitest/blob/4ee66c021e0592c886dbab727f0f8da9366f99ab/packages/browser/src/node/projectParent.ts#L110-L121) [packages/browser/src/node/project.ts#L72-83](https://github.com/vitest-dev/vitest/blob/4ee66c021e0592c886dbab727f0f8da9366f99ab/packages/browser/src/node/project.ts#L72-L83) [packages/browser/src/node/index.ts#L42-45](https://github.com/vitest-dev/vitest/blob/4ee66c021e0592c886dbab727f0f8da9366f99ab/packages/browser/src/node/index.ts#L42-L45)
- ReportersMap is the built-in output registry, while config.sequence.sequencer supplies shard and sort behavior before execution grouping; these are separate presentation and scheduling extension boundaries. — [packages/vitest/src/node/reporters/index.ts#L40-56](https://github.com/vitest-dev/vitest/blob/4ee66c021e0592c886dbab727f0f8da9366f99ab/packages/vitest/src/node/reporters/index.ts#L40-L56) [packages/vitest/src/node/pool.ts#L53-87](https://github.com/vitest-dev/vitest/blob/4ee66c021e0592c886dbab727f0f8da9366f99ab/packages/vitest/src/node/pool.ts#L53-L87)
- Snapshot customization includes composable matcher helpers and storage environments; SnapshotState.create can consume readSnapshotFileData directly instead of evaluating text, and NodeSnapshotEnvironment accepts a custom snapshot-directory name. — [packages/vitest/src/integrations/snapshot/chai.ts#L343-369](https://github.com/vitest-dev/vitest/blob/4ee66c021e0592c886dbab727f0f8da9366f99ab/packages/vitest/src/integrations/snapshot/chai.ts#L343-L369) [packages/vitest/src/integrations/snapshot/chai.ts#L450-488](https://github.com/vitest-dev/vitest/blob/4ee66c021e0592c886dbab727f0f8da9366f99ab/packages/vitest/src/integrations/snapshot/chai.ts#L450-L488) [packages/snapshot/src/port/state.ts#L141-151](https://github.com/vitest-dev/vitest/blob/4ee66c021e0592c886dbab727f0f8da9366f99ab/packages/snapshot/src/port/state.ts#L141-L151) [packages/snapshot/src/env/node.ts#L20-24](https://github.com/vitest-dev/vitest/blob/4ee66c021e0592c886dbab727f0f8da9366f99ab/packages/snapshot/src/env/node.ts#L20-L24)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
