Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions docs/api/advanced/reporters.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Vitest has its own test run lifecycle. These are represented by reporter's metho
- [`onHookStart(beforeAll)`](#onhookstart)
- [`onHookEnd(beforeAll)`](#onhookend)
- [`onTestCaseReady`](#ontestcaseready)
- [`onTestAnnotate`](#ontestannotate) <Version>3.2.0</Version>
- [`onTestCaseAnnotate`](#ontestcaseannotate) <Version>3.2.0</Version>
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was just documented incorrectly, the API was always onTestCaseAnnotate

- [`onTestCaseArtifactRecord`](#ontestcaseartifactrecord) <Version type="experimental">4.0.11</Version>
- [`onHookStart(beforeEach)`](#onhookstart)
- [`onHookEnd(beforeEach)`](#onhookend)
Expand Down Expand Up @@ -313,16 +313,16 @@ This method is called when the test has finished running or was just skipped. No

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

## onTestAnnotate <Version>3.2.0</Version> {#ontestannotate}
## onTestCaseAnnotate <Version>3.2.0</Version> {#ontestcaseannotate}

```ts
function onTestAnnotate(
function onTestCaseAnnotate(
testCase: TestCase,
annotation: TestAnnotation,
): Awaitable<void>
```

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.
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.

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.

Expand Down
6 changes: 5 additions & 1 deletion docs/api/advanced/test-module.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,14 @@ interface ImportDuration {
}
```

## viteEnvironment <Version type="experimental">4.0.15</Version> <Experimental /> {#viteenvironment}
## viteEnvironment <Version>4.1.0</Version> {#viteenvironment}

This is a Vite's [`DevEnvironment`](https://vite.dev/guide/api-environment) that transforms all files inside of the test module.

::: details History
- `v4.0.15`: added as experimental
:::

## toTestSpecification <Version>4.1.0</Version> {#totestspecification}

```ts
Expand Down
2 changes: 1 addition & 1 deletion docs/api/advanced/test-specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The ID of the module in Vite's module graph. Usually, it's an absolute file path

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

## pool <Badge type="warning">experimental</Badge> {#pool}
## pool {#pool}

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

Expand Down
4 changes: 1 addition & 3 deletions docs/api/advanced/vitest.md
Original file line number Diff line number Diff line change
Expand Up @@ -478,9 +478,7 @@ function onCancel(fn: (reason: CancelReason) => Awaitable<void>): () => void

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

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

## onClose

Expand Down
1 change: 0 additions & 1 deletion docs/api/browser/context.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ export const utils: {
/**
* Configures default options of `prettyDOM` and `debug` functions.
* This will also affect `vitest-browser-{framework}` package.
* @experimental
*/
configurePrettyDOM(options: StringifyOptions): void
/**
Expand Down
4 changes: 0 additions & 4 deletions docs/guide/advanced/tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ for (const testModule of testModules) {
}
```

::: tip
[`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.
:::

## `createVitest`

Creates a [Vitest](/api/advanced/vitest) instances without running tests.
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import type { Environment } from 'vitest/runtime'
export default <Environment>{
name: 'custom',
viteEnvironment: 'ssr',
// optional - only if you support "experimental-vm" pool
// optional - only if you support "vmForks" or "vmThreads" pools
async setupVM() {
const vm = await import('node:vm')
const context = vm.createContext()
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/snapshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ It will compare with the content of `./test/basic.output.html`. And can be writt

## Visual Snapshots

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:
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:

```ts
import { expect, test } from 'vitest'
Expand Down
1 change: 0 additions & 1 deletion packages/browser/context.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,6 @@ export const utils: {
/**
* Configures default options of `prettyDOM` and `debug` functions.
* This will also affect `vitest-browser-{framework}` package.
* @experimental
*/
configurePrettyDOM(options: StringifyOptions): void
/**
Expand Down
3 changes: 0 additions & 3 deletions packages/browser/src/client/tester/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -492,9 +492,6 @@ function getElementError(selector: string, container: Element): Error {
return error
}

/**
* @experimental
*/
function configurePrettyDOM(options: StringifyOptions) {
defaultOptions = options
}
Expand Down
1 change: 0 additions & 1 deletion packages/mocker/src/node/hoistMocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export interface HoistMocksOptions {
* @default ["hoisted"]
*/
hoistedMethodNames?: string[]
// @experimental, TODO
globalThisAccessor?: string
regexpHoistable?: RegExp
codeFrameGenerator?: CodeFrameGenerator
Expand Down
1 change: 0 additions & 1 deletion packages/vitest/src/node/test-specification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export class TestSpecification {
public readonly moduleId: string
/**
* The current test pool. It's possible to have multiple pools in a single test project with `typecheck.enabled`.
* @experimental In later versions, the project will only support a single pool.
*/
public readonly pool: Pool
/**
Expand Down
1 change: 0 additions & 1 deletion packages/vitest/src/node/types/reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export interface Reporter {
/**
* Called when the project initiated the browser instance.
* project.browser will always be defined.
* @experimental
*/
onBrowserInit?: (project: TestProject) => Awaitable<void>
/** @internal */
Expand Down
Loading