Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
7402bf5
feat: new benchmarks API
sheremet-va Mar 28, 2026
dadf4d8
chore: cleanup
sheremet-va Apr 3, 2026
93efa43
Merge branch 'main' of github.com:vitest-dev/vitest into feat/rewrite…
sheremet-va Apr 9, 2026
d0608e1
chore: rewrite
sheremet-va Apr 9, 2026
dd332b3
refactor: deprecate mode
sheremet-va Apr 9, 2026
233ae1b
chore: remove
sheremet-va Apr 9, 2026
87c0c33
chore: cleanup
sheremet-va Apr 9, 2026
4f94ebd
feat: print table
sheremet-va Apr 9, 2026
33b0401
refactor: empty line between benchmarks
sheremet-va Apr 9, 2026
a3cd97a
chore: docs
sheremet-va Apr 9, 2026
4f8b7fa
docs: add snippet of how table looks like
sheremet-va Apr 9, 2026
6c55f51
chore: remove run
sheremet-va Apr 9, 2026
29882c5
feat(expect): add assertions
sheremet-va Apr 9, 2026
2de7b30
chore: cleanup
sheremet-va Apr 9, 2026
c130d19
chore: rename to `compare`
sheremet-va Apr 10, 2026
5570443
chore: cleanup
sheremet-va Apr 10, 2026
e2a9b07
chore: remove test.bench
sheremet-va Apr 10, 2026
d8b411b
fix: use `benchmark.retainSamples`
sheremet-va Apr 10, 2026
1f84eb9
feat: include benchmarks in the json reporter
sheremet-va Apr 10, 2026
c97dcd0
docs: add stability section
sheremet-va Apr 10, 2026
b3200ad
fix: validate benchmark project
sheremet-va Apr 10, 2026
08c559a
chore: 1
sheremet-va Apr 13, 2026
4f1de15
Merge branch 'main' of github.com:vitest-dev/vitest into feat/rewrite…
sheremet-va Apr 16, 2026
bfa625c
refactor: extend serialized config from runner
sheremet-va Apr 16, 2026
9e0ff64
chore: cleanup
sheremet-va Apr 16, 2026
1c419c9
chore: delete old benchmarking tests
sheremet-va Apr 16, 2026
74aaebb
chore: delete old bench tests
sheremet-va Apr 16, 2026
1eaf7f4
chore: filtering
sheremet-va Apr 16, 2026
6cf4695
feat: per project
sheremet-va Apr 16, 2026
d393e62
chore: design
sheremet-va Apr 17, 2026
3a8f2f6
fix: return updated projects
sheremet-va Apr 17, 2026
9a74787
fix: filtering bench projects
sheremet-va Apr 17, 2026
77a67c2
chore: cleanup
sheremet-va Apr 17, 2026
15651f6
refactor: move benchmarking
sheremet-va Apr 17, 2026
1f85dea
refactor: move resolvers
sheremet-va Apr 17, 2026
542e561
refactor: save baselines on the main thread automatically
sheremet-va Apr 17, 2026
a6634dd
fix: check file access for baseline
sheremet-va Apr 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,10 @@ export default ({ mode }: { mode: string }) => {
text: 'Testing Types',
link: '/guide/testing-types',
},
{
text: 'Benchmarking',
link: '/guide/benchmarking',
},
{
text: 'Vitest UI',
link: '/guide/ui',
Expand Down
4 changes: 2 additions & 2 deletions docs/api/advanced/vitest.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ Vitest 4 added several new APIs (they are marked with a "4.0.0+" badge) and remo
- `listFile` (use [`getRelevantTestSpecifications`](#getrelevanttestspecifications) instead)
:::

## mode
## mode <Deprecated /> {#mode}

### test

Test mode will only call functions inside `test` or `it`, and throws an error when `bench` is encountered. This mode uses `include` and `exclude` options in the config to find test files.

### benchmark <Badge type="warning">experimental</Badge>
### benchmark

Benchmark mode calls `bench` functions and throws an error, when it encounters `test` or `it`. This mode uses `benchmark.include` and `benchmark.exclude` options in the config to find benchmark files.

Expand Down
37 changes: 2 additions & 35 deletions docs/config/benchmark.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,39 +32,6 @@ Include globs for in-source benchmark test files. This option is similar to [`in

When defined, Vitest will run all matched files with `import.meta.vitest` inside.

## benchmark.reporters
## benchmark.retainSamples

- **Type:** `Arrayable<BenchmarkBuiltinReporters | Reporter>`
- **Default:** `'default'`

Custom reporter for output. Can contain one or more built-in report names, reporter instances, and/or paths to custom reporters.

## benchmark.outputFile

Deprecated in favor of `benchmark.outputJson`.

## benchmark.outputJson {#benchmark-outputJson}

- **Type:** `string | undefined`
- **Default:** `undefined`

A file path to store the benchmark result, which can be used for `--compare` option later.

For example:

```sh
# save main branch's result
git checkout main
vitest bench --outputJson main.json

# change a branch and compare against main
git checkout feature
vitest bench --compare main.json
```

## benchmark.compare {#benchmark-compare}

- **Type:** `string | undefined`
- **Default:** `undefined`

A file path to a previous benchmark result to compare against current runs.
Include `samples` array of benchmark results for API or custom reporter usages.
2 changes: 0 additions & 2 deletions docs/guide/advanced/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ You can import any method from the `vitest/node` entry-point.

```ts
function startVitest(
mode: VitestRunMode,
cliFilters: string[] = [],
options: CliOptions = {},
viteOverrides?: ViteUserConfig,
Expand Down Expand Up @@ -60,7 +59,6 @@ The ["Running Tests"](/guide/advanced/tests#startvitest) guide has a usage examp

```ts
function createVitest(
mode: VitestRunMode,
options: CliOptions,
viteOverrides: ViteUserConfig = {},
vitestOptions: VitestOptions = {},
Expand Down
Loading
Loading