From 4c6e78731a5f2d553bc17996b2a3dd8a38d1ccbc Mon Sep 17 00:00:00 2001 From: NoiseFan Date: Mon, 18 May 2026 19:05:45 +0800 Subject: [PATCH] docs: use unified `` label (#10372) --- docs/api/advanced/vitest.md | 6 +++--- docs/api/browser/assertions.md | 2 +- docs/guide/browser/aria-snapshots.md | 2 +- docs/guide/features.md | 4 ++-- docs/guide/migration.md | 2 +- docs/guide/snapshot.md | 6 +++--- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/api/advanced/vitest.md b/docs/api/advanced/vitest.md index 7ff17b48e..37e335f28 100644 --- a/docs/api/advanced/vitest.md +++ b/docs/api/advanced/vitest.md @@ -8,7 +8,7 @@ title: Vitest API Vitest instance requires the current test mode. It can be either: - `test` when running runtime tests -- `benchmark` when running benchmarks experimental +- `benchmark` when running benchmarks ::: details New in Vitest 4 Vitest 4 added several new APIs (they are marked with a "4.0.0+" badge) and removed deprecated APIs: @@ -31,7 +31,7 @@ Vitest 4 added several new APIs (they are marked with a "4.0.0+" badge) and remo 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 experimental +### benchmark {#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. @@ -47,7 +47,7 @@ This is Vitest config, it doesn't extend _Vite_ config. It only has resolved val This is a global [`ViteDevServer`](https://vite.dev/guide/api-javascript#vitedevserver). -## state experimental +## state {#state} ::: warning Public `state` is an experimental API (except `vitest.state.getReportedEntity`). Breaking changes might not follow SemVer, please pin Vitest's version when using it. diff --git a/docs/api/browser/assertions.md b/docs/api/browser/assertions.md index c1c0cd078..7c2d905da 100644 --- a/docs/api/browser/assertions.md +++ b/docs/api/browser/assertions.md @@ -1068,7 +1068,7 @@ await expect.element(queryByTestId('prev')).not.toHaveSelection() await expect.element(queryByTestId('next')).toHaveSelection('ne') ``` -## toMatchScreenshot experimental {#tomatchscreenshot} +## toMatchScreenshot {#tomatchscreenshot} ```ts function toMatchScreenshot( diff --git a/docs/guide/browser/aria-snapshots.md b/docs/guide/browser/aria-snapshots.md index d7d8ae76f..572944183 100644 --- a/docs/guide/browser/aria-snapshots.md +++ b/docs/guide/browser/aria-snapshots.md @@ -3,7 +3,7 @@ title: ARIA Snapshots | Guide outline: deep --- -# ARIA Snapshots experimental 4.1.4 +# ARIA Snapshots 4.1.4 {#aria-snapshots} ARIA snapshots let you test the accessibility structure of your pages. Instead of asserting against raw HTML or visual output, you assert against the accessibility tree — the same structure that screen readers and other assistive technologies use. diff --git a/docs/guide/features.md b/docs/guide/features.md index 31bc5373a..3c73a69cc 100644 --- a/docs/guide/features.md +++ b/docs/guide/features.md @@ -194,7 +194,7 @@ if (import.meta.vitest) { Learn more at [In-source testing](/guide/in-source). -## Benchmarking Experimental {#benchmarking} +## Benchmarking {#benchmarking} You can run benchmark tests with [`bench`](/api/test#bench) function via [Tinybench](https://github.com/tinylibs/tinybench) to compare performance results. @@ -221,7 +221,7 @@ describe('sort', () => { Benchmark report Benchmark report -## Type Testing Experimental {#type-testing} +## Type Testing {#type-testing} 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/migration.md b/docs/guide/migration.md index 45b19e634..93c10a080 100644 --- a/docs/guide/migration.md +++ b/docs/guide/migration.md @@ -712,7 +712,7 @@ export default defineConfig({ Otherwise your snapshots will have a lot of escaped `"` characters. -### Custom Snapshot Matchers experimental 4.1.3 +### Custom Snapshot Matchers 4.1.3 {#custom-snapshot-matcher} Jest imports snapshot composables from `jest-snapshot`. In Vitest, use `Snapshots` from `vitest` instead: diff --git a/docs/guide/snapshot.md b/docs/guide/snapshot.md index e99faccd2..9db1f71fe 100644 --- a/docs/guide/snapshot.md +++ b/docs/guide/snapshot.md @@ -124,7 +124,7 @@ test('button looks correct', async () => { This captures screenshots and compares them against reference images to detect unintended visual changes. Learn more in the [Visual Regression Testing guide](/guide/browser/visual-regression-testing). -## ARIA Snapshots experimental 4.1.4 +## ARIA Snapshots 4.1.4 {#aria-snapshots} ARIA snapshots capture the accessibility tree of a DOM element and compare it against a stored template. Based on [Playwright's ARIA snapshots](https://playwright.dev/docs/aria-snapshots), they provide a semantic alternative to visual regression testing — asserting structure and meaning rather than pixels. @@ -236,7 +236,7 @@ Pretty foo: Object { } ``` -## Custom Snapshot Matchers experimental 4.1.3 {#custom-snapshot-matchers} +## Custom Snapshot Matchers 4.1.3 {#custom-snapshot-matchers} You can build custom snapshot matchers using the composable functions exposed on `Snapshots` from `vitest`. These let you transform values before snapshotting while preserving full snapshot lifecycle support (creation, update, inline rewriting). @@ -335,7 +335,7 @@ declare module 'vitest' { See [Extending Matchers](/guide/extending-matchers) for more on `expect.extend` and custom matcher conventions. ::: -## Custom Snapshot Domain experimental 4.1.4 {#custom-snapshot-domain} +## Custom Snapshot Domain 4.1.4 {#custom-snapshot-domain} Custom serializers control how values are _rendered_ into snapshot strings, but comparison is still string equality. A **domain snapshot adapter** goes further: it owns the entire comparison pipeline for a custom matcher, including how to capture a value, render it, parse a stored snapshot, and match them semantically. -- 2.51.2