`
@@ -2071,7 +2071,7 @@ Relevant only when using with `shouldAdvanceTime: true`. increment mocked time b
Tells fake timers to clear "native" (i.e. not fake) timers by delegating to their respective handlers. These are not cleared by default, leading to potentially unexpected behavior if timers existed prior to starting fake timers session.
-### workspace 1.1.0+
+### workspace 1.1.0+ {#workspace}
- **Type:** `string`
- **CLI:** `--workspace=./file.js`
@@ -2079,7 +2079,7 @@ Tells fake timers to clear "native" (i.e. not fake) timers by delegating to thei
Path to a [workspace](/guide/workspace) config file relative to [root](#root).
-### isolate 1.1.0+
+### isolate 1.1.0+ {#isolate}
- **Type:** `boolean`
- **Default:** `true`
diff --git a/docs/guide/browser.md b/docs/guide/browser.md
index dc527db31..316d783c5 100644
--- a/docs/guide/browser.md
+++ b/docs/guide/browser.md
@@ -2,7 +2,7 @@
title: Browser Mode | Guide
---
-# Browser Mode Experimental
+# Browser Mode Experimental {#browser-mode}
This page provides information about the experimental browser mode feature in the Vitest API, which allows you to run your tests in the browser natively, providing access to browser globals like window and document. This feature is currently under development, and APIs may change in the future.
diff --git a/docs/guide/common-errors.md b/docs/guide/common-errors.md
index dde26b2d4..5831dbae0 100644
--- a/docs/guide/common-errors.md
+++ b/docs/guide/common-errors.md
@@ -61,7 +61,7 @@ vi.resetModules()
## Failed to terminate worker
-This error can happen when NodeJS's `fetch` is used with default [`pool: 'threads'`](/config/#pool-1-0-0). This issue is tracked on issue [Timeout abort can leave process(es) running in the background #3077](https://github.com/vitest-dev/vitest/issues/3077).
+This error can happen when NodeJS's `fetch` is used with default [`pool: 'threads'`](/config/#threads). This issue is tracked on issue [Timeout abort can leave process(es) running in the background #3077](https://github.com/vitest-dev/vitest/issues/3077).
As work-around you can switch to [`pool: 'forks'`](/config/#forks) or [`pool: 'vmForks'`](/config/#vmforks).
diff --git a/docs/guide/coverage.md b/docs/guide/coverage.md
index 72447aba6..f81fbbb4e 100644
--- a/docs/guide/coverage.md
+++ b/docs/guide/coverage.md
@@ -216,7 +216,7 @@ To see all configurable options for coverage, see the [coverage Config Reference
## Vitest UI
-Since Vitest 0.31.0, you can check your coverage report in [Vitest UI](./ui).
+Since Vitest 0.31.0, you can check your coverage report in [Vitest UI](/guide/ui).
Vitest UI will enable coverage report when it is enabled explicitly and the html coverage reporter is present, otherwise it will not be available:
- enable `coverage.enabled=true` in your configuration or run Vitest with `--coverage.enabled=true` flag
diff --git a/docs/guide/features.md b/docs/guide/features.md
index 80069e641..d44a9c381 100644
--- a/docs/guide/features.md
+++ b/docs/guide/features.md
@@ -32,9 +32,9 @@ Out-of-the-box ES Module / TypeScript / JSX support / PostCSS
## Threads
-By default Vitest runs test files in multiple threads using [`node:worker_threads`](https://nodejs.org/api/worker_threads.html) via [Tinypool](https://github.com/tinylibs/tinypool) (a lightweight fork of [Piscina](https://github.com/piscinajs/piscina)), allowing tests to run simultaneously. If your tests are running code that is not compatible with multi-threading, you can switch to [`--pool=forks`](/config/#pool-1-0-0) which runs tests in multiple processes using [`node:child_process`](https://nodejs.org/api/child_process.html) via Tinypool.
+By default Vitest runs test files in multiple threads using [`node:worker_threads`](https://nodejs.org/api/worker_threads.html) via [Tinypool](https://github.com/tinylibs/tinypool) (a lightweight fork of [Piscina](https://github.com/piscinajs/piscina)), allowing tests to run simultaneously. If your tests are running code that is not compatible with multi-threading, you can switch to [`--pool=forks`](/config/#pool) which runs tests in multiple processes using [`node:child_process`](https://nodejs.org/api/child_process.html) via Tinypool.
-To run tests in a single thread or process, see [`poolOptions`](/config/#pooloptions-1-0-0).
+To run tests in a single thread or process, see [`poolOptions`](/config/#pooloptions).
Vitest also isolates each file's environment so env mutations in one file don't affect others. Isolation can be disabled by passing `--no-isolate` to the CLI (trading correctness for run performance).
@@ -42,7 +42,7 @@ Vitest also isolates each file's environment so env mutations in one file don't
Vitest provided many ways to narrow down the tests to run in order to speed up testing so you can focus on development.
-Learn more about [Test Filtering](./filtering.md).
+Learn more about [Test Filtering](/guide/filtering).
## Running Tests Concurrently
@@ -75,7 +75,7 @@ describe.concurrent('suite', () => {
You can also use `.skip`, `.only`, and `.todo` with concurrent suites and tests. Read more in the [API Reference](/api/#test-concurrent).
::: warning
-When running concurrent tests, Snapshots and Assertions must use `expect` from the local [Test Context](/guide/test-context.md) to ensure the right test is detected.
+When running concurrent tests, Snapshots and Assertions must use `expect` from the local [Test Context](/guide/test-context) to ensure the right test is detected.
:::
## Snapshot
@@ -185,7 +185,7 @@ if (import.meta.vitest) {
Learn more at [In-source testing](/guide/in-source).
-## Benchmarking Experimental
+## Benchmarking Experimental {#benchmarking}
Since Vitest 0.23.0, you can run benchmark tests with [`bench`](/api/#bench)
function via [Tinybench](https://github.com/tinylibs/tinybench) to compare performance results.
@@ -210,7 +210,7 @@ describe('sort', () => {
})
```
-## Type Testing Experimental
+## Type Testing Experimental {#type-testing}
Since Vitest 0.25.0 you can [write tests](/guide/testing-types) to catch type regressions. Vitest comes with [`expect-type`](https://github.com/mmkal/expect-type) package to provide you with a similar and easy to understand API.
diff --git a/docs/guide/ide.md b/docs/guide/ide.md
index 33fc2c099..0a9cb35dc 100644
--- a/docs/guide/ide.md
+++ b/docs/guide/ide.md
@@ -4,7 +4,7 @@ title: IDE Integrations | Guide
# IDE Integrations
-## VS Code Official
+## VS Code Official {#vs-code}
diff --git a/docs/guide/improving-performance.md b/docs/guide/improving-performance.md
index f12446eb3..1ef6066ad 100644
--- a/docs/guide/improving-performance.md
+++ b/docs/guide/improving-performance.md
@@ -33,7 +33,7 @@ export default defineConfig({
If you are using `vmThreads` pool, you cannot disable isolation. Use `threads` pool instead to improve your tests performance.
:::
-For some projects, it might also be desirable to disable parallelism to improve startup time. To do that, provide `--no-file-parallelism` flag to the CLI or set [`test.fileParallelism`](/config/#fileParallelism) property in the config to `false`.
+For some projects, it might also be desirable to disable parallelism to improve startup time. To do that, provide `--no-file-parallelism` flag to the CLI or set [`test.fileParallelism`](/config/#fileparallelism) property in the config to `false`.
::: code-group
```bash [CLI]
diff --git a/docs/guide/in-source.md b/docs/guide/in-source.md
index 3360823a3..0c3a8f1d1 100644
--- a/docs/guide/in-source.md
+++ b/docs/guide/in-source.md
@@ -87,7 +87,7 @@ export default defineBuildConfig({
})
```
-Learn more: unbuild
+Learn more: [unbuild](https://github.com/unjs/unbuild)
@@ -108,7 +108,7 @@ export default {
}
```
-Learn more: Rollup
+Learn more: [Rollup](https://rollupjs.org/)
diff --git a/docs/guide/index.md b/docs/guide/index.md
index 0d95293de..f3f549195 100644
--- a/docs/guide/index.md
+++ b/docs/guide/index.md
@@ -8,7 +8,7 @@ title: Getting Started | Guide
Vitest is a next generation testing framework powered by Vite.
-You can learn more about the rationale behind the project in the [Why Vitest](./why) section.
+You can learn more about the rationale behind the project in the [Why Vitest](/guide/why) section.
## Trying Vitest Online
@@ -209,7 +209,7 @@ In a project where Vitest is installed, you can use the `vitest` binary in your
To run tests once without watching for file changes, use `vitest run`.
You can specify additional CLI options like `--port` or `--https`. For a full list of CLI options, run `npx vitest --help` in your project.
-Learn more about the [Command Line Interface](./cli.md)
+Learn more about the [Command Line Interface](/guide/cli)
## IDE Integrations
@@ -217,7 +217,7 @@ We also provided a official extension for Visual Studio Code to enhance your tes
[Install from VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=ZixuanChen.vitest-explorer)
-Learn more about [IDE Integrations](./ide.md)
+Learn more about [IDE Integrations](/guide/ide)
## Examples
diff --git a/docs/guide/migration.md b/docs/guide/migration.md
index c879c5513..8f9173906 100644
--- a/docs/guide/migration.md
+++ b/docs/guide/migration.md
@@ -202,7 +202,7 @@ Just like Jest, Vitest sets `NODE_ENV` to `test`, if it wasn't set before. Vites
### Replace property
-If you want to modify the object, you will use [replaceProperty API](https://jestjs.io/docs/jest-object#jestreplacepropertyobject-propertykey-value) in Jest, you can use [`vi.stubEnv`](https://vitest.dev/api/vi.html#vi-stubenv) or [`vi.spyOn`](/api/vi#vi-spyon) to do the same also in Vitest.
+If you want to modify the object, you will use [replaceProperty API](https://jestjs.io/docs/jest-object#jestreplacepropertyobject-propertykey-value) in Jest, you can use [`vi.stubEnv`](/api/#vi-stubenv) or [`vi.spyOn`](/api/vi#vi-spyon) to do the same also in Vitest.
### Done Callback
diff --git a/docs/guide/mocking.md b/docs/guide/mocking.md
index e40b9b108..60d4dce64 100644
--- a/docs/guide/mocking.md
+++ b/docs/guide/mocking.md
@@ -663,7 +663,7 @@ it('changes value', () => {
})
```
-If you want to automatically reset value, you can use `vi.stubEnv` helper with [`unstubEnvs`](/config/#unstubEnvs) config option enabled (or call [`vi.unstubAllEnvs`](/api/vi#vi-unstuballenvs) manually in `beforeEach` hook):
+If you want to automatically reset value, you can use `vi.stubEnv` helper with [`unstubEnvs`](/config/#unstubenvs) config option enabled (or call [`vi.unstubAllEnvs`](/api/vi#vi-unstuballenvs) manually in `beforeEach` hook):
```ts
import { expect, it, vi } from 'vitest'
diff --git a/docs/guide/reporters.md b/docs/guide/reporters.md
index b69b73fb8..ca4e19ec8 100644
--- a/docs/guide/reporters.md
+++ b/docs/guide/reporters.md
@@ -444,7 +444,7 @@ export default defineConfig({
```
:::
-### Github Actions Reporter 1.3.0+
+### Github Actions Reporter 1.3.0+ {#github-actions-reporter}
Output [workflow commands](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-error-message)
to provide annotations for test failures. This reporter is automatically enabled with a [`default`](#default-reporter) reporter when `process.env.GITHUB_ACTIONS === 'true'`.
diff --git a/docs/guide/snapshot.md b/docs/guide/snapshot.md
index 727ad8c99..93fd933d5 100644
--- a/docs/guide/snapshot.md
+++ b/docs/guide/snapshot.md
@@ -34,7 +34,7 @@ exports['toUpperCase 1'] = '"FOOBAR"'
The snapshot artifact should be committed alongside code changes, and reviewed as part of your code review process. On subsequent test runs, Vitest will compare the rendered output with the previous snapshot. If they match, the test will pass. If they don't match, either the test runner found a bug in your code that should be fixed, or the implementation has changed and the snapshot needs to be updated.
::: warning
-When using Snapshots with async concurrent tests, `expect` from the local [Test Context](/guide/test-context.md) must be used to ensure the right test is detected.
+When using Snapshots with async concurrent tests, `expect` from the local [Test Context](/guide/test-context) must be used to ensure the right test is detected.
:::
## Inline Snapshots
@@ -64,7 +64,7 @@ it('toUpperCase', () => {
This allows you to see the expected output directly without jumping across different files.
::: warning
-When using Snapshots with async concurrent tests, `expect` from the local [Test Context](/guide/test-context.md) must be used to ensure the right test is detected.
+When using Snapshots with async concurrent tests, `expect` from the local [Test Context](/guide/test-context) must be used to ensure the right test is detected.
:::
## Updating Snapshots
@@ -137,7 +137,7 @@ expect.addSnapshotSerializer({
})
```
-We also support [snapshotSerializers](/config/#snapshotserializers-1-3-0) option to implicitly add custom serializers.
+We also support [snapshotSerializers](/config/#snapshotserializers) option to implicitly add custom serializers.
```ts
import { SnapshotSerializer } from 'vitest'