Skip to content

Commit b5fd2a1

Browse files
authored
feat: stabilize experimental features (#9529)
1 parent 5a7275f commit b5fd2a1

File tree

13 files changed

+13
-23
lines changed

13 files changed

+13
-23
lines changed

docs/api/advanced/reporters.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Vitest has its own test run lifecycle. These are represented by reporter's metho
1515
- [`onHookStart(beforeAll)`](#onhookstart)
1616
- [`onHookEnd(beforeAll)`](#onhookend)
1717
- [`onTestCaseReady`](#ontestcaseready)
18-
- [`onTestAnnotate`](#ontestannotate) <Version>3.2.0</Version>
18+
- [`onTestCaseAnnotate`](#ontestcaseannotate) <Version>3.2.0</Version>
1919
- [`onTestCaseArtifactRecord`](#ontestcaseartifactrecord) <Version type="experimental">4.0.11</Version>
2020
- [`onHookStart(beforeEach)`](#onhookstart)
2121
- [`onHookEnd(beforeEach)`](#onhookend)
@@ -313,16 +313,16 @@ This method is called when the test has finished running or was just skipped. No
313313

314314
At this point, [`testCase.result()`](/api/advanced/test-case#result) will have non-pending state.
315315

316-
## onTestAnnotate <Version>3.2.0</Version> {#ontestannotate}
316+
## onTestCaseAnnotate <Version>3.2.0</Version> {#ontestcaseannotate}
317317

318318
```ts
319-
function onTestAnnotate(
319+
function onTestCaseAnnotate(
320320
testCase: TestCase,
321321
annotation: TestAnnotation,
322322
): Awaitable<void>
323323
```
324324

325-
The `onTestAnnotate` hook is associated with the [`context.annotate`](/guide/test-context#annotate) method. When `annotate` is invoked, Vitest serialises it and sends the same attachment to the main thread where reporter can interact with it.
325+
The `onTestCaseAnnotate` hook is associated with the [`context.annotate`](/guide/test-context#annotate) method. When `annotate` is invoked, Vitest serialises it and sends the same attachment to the main thread where reporter can interact with it.
326326

327327
If the path is specified, Vitest stores it in a separate directory (configured by [`attachmentsDir`](/config/#attachmentsdir)) and modifies the `path` property to reference it.
328328

docs/api/advanced/test-module.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,14 @@ interface ImportDuration {
121121
}
122122
```
123123
124-
## viteEnvironment <Version type="experimental">4.0.15</Version> <Experimental /> {#viteenvironment}
124+
## viteEnvironment <Version>4.1.0</Version> {#viteenvironment}
125125
126126
This is a Vite's [`DevEnvironment`](https://vite.dev/guide/api-environment) that transforms all files inside of the test module.
127127
128+
::: details History
129+
- `v4.0.15`: added as experimental
130+
:::
131+
128132
## toTestSpecification <Version>4.1.0</Version> {#totestspecification}
129133
130134
```ts

docs/api/advanced/test-specification.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ The ID of the module in Vite's module graph. Usually, it's an absolute file path
4040

4141
Instance of [`TestModule`](/api/advanced/test-module) associated with the specification. If test wasn't queued yet, this will be `undefined`.
4242

43-
## pool <Badge type="warning">experimental</Badge> {#pool}
43+
## pool {#pool}
4444

4545
The [`pool`](/config/#pool) in which the test module will run.
4646

docs/api/advanced/vitest.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -478,9 +478,7 @@ function onCancel(fn: (reason: CancelReason) => Awaitable<void>): () => void
478478

479479
Register a handler that will be called when the test run is cancelled with [`vitest.cancelCurrentRun`](#cancelcurrentrun).
480480

481-
::: warning EXPERIMENTAL
482-
Since 4.0.10, `onCancel` returns a teardown function that will remove the listener.
483-
:::
481+
Since 4.0.10, `onCancel` experimentally returns a teardown function that will remove the listener. Since 4.1.0 this behaviour is considered stable.
484482

485483
## onClose
486484

docs/api/browser/context.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ export const utils: {
222222
/**
223223
* Configures default options of `prettyDOM` and `debug` functions.
224224
* This will also affect `vitest-browser-{framework}` package.
225-
* @experimental
226225
*/
227226
configurePrettyDOM(options: StringifyOptions): void
228227
/**

docs/guide/advanced/tests.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ for (const testModule of testModules) {
2727
}
2828
```
2929

30-
::: tip
31-
[`TestModule`](/api/advanced/test-module), [`TestSuite`](/api/advanced/test-suite) and [`TestCase`](/api/advanced/test-case) APIs are not experimental and follow SemVer since Vitest 2.1.
32-
:::
33-
3430
## `createVitest`
3531

3632
Creates a [Vitest](/api/advanced/vitest) instances without running tests.

docs/guide/environment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ import type { Environment } from 'vitest/runtime'
4949
export default <Environment>{
5050
name: 'custom',
5151
viteEnvironment: 'ssr',
52-
// optional - only if you support "experimental-vm" pool
52+
// optional - only if you support "vmForks" or "vmThreads" pools
5353
async setupVM() {
5454
const vm = await import('node:vm')
5555
const context = vm.createContext()

docs/guide/snapshot.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ It will compare with the content of `./test/basic.output.html`. And can be writt
9898

9999
## Visual Snapshots
100100

101-
For visual regression testing of UI components and pages, Vitest provides built-in support through [browser mode](/guide/browser/) with the [`toMatchScreenshot()`](/api/browser/assertions#tomatchscreenshot-experimental) assertion:
101+
For visual regression testing of UI components and pages, Vitest provides built-in support through [browser mode](/guide/browser/) with the [`toMatchScreenshot()`](/api/browser/assertions#tomatchscreenshot) assertion:
102102

103103
```ts
104104
import { expect, test } from 'vitest'

packages/browser/context.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,6 @@ export const utils: {
866866
/**
867867
* Configures default options of `prettyDOM` and `debug` functions.
868868
* This will also affect `vitest-browser-{framework}` package.
869-
* @experimental
870869
*/
871870
configurePrettyDOM(options: StringifyOptions): void
872871
/**

packages/browser/src/client/tester/context.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -492,9 +492,6 @@ function getElementError(selector: string, container: Element): Error {
492492
return error
493493
}
494494

495-
/**
496-
* @experimental
497-
*/
498495
function configurePrettyDOM(options: StringifyOptions) {
499496
defaultOptions = options
500497
}

0 commit comments

Comments
 (0)