Skip to content

Commit 46c5db1

Browse files
committed
docs: apply review suggestions
1 parent 01241ee commit 46c5db1

File tree

5 files changed

+14
-6
lines changed

5 files changed

+14
-6
lines changed

docs/.vitepress/components.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export {}
77
/* prettier-ignore */
88
declare module 'vue' {
99
export interface GlobalComponents {
10+
Advanced: typeof import('./components/Advanced.vue')['default']
1011
ArrowDown: typeof import('./components/ArrowDown.vue')['default']
1112
BlogIndex: typeof import('./components/BlogIndex.vue')['default']
1213
Box: typeof import('./components/Box.vue')['default']
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<template>
2+
<Badge type="danger" title="This is an advanced API intended for library authors and framework integrations. Most users should not need this." class="cursor-help">
3+
advanced
4+
</Badge>
5+
</template>

docs/.vitepress/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@ export default ({ mode }: { mode: string }) => {
994994
link: '/api/advanced/metadata',
995995
},
996996
{
997-
text: 'Artifacts',
997+
text: 'TestArtifact',
998998
link: '/api/advanced/artifacts',
999999
},
10001000
],

docs/api/advanced/artifacts.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ outline: deep
33
title: Test Artifacts
44
---
55

6-
# Test Artifacts <Badge type="danger">advanced</Badge> <Badge type="warning">experimental</Badge>
6+
# Test Artifacts <Advanced /> <Version type="experimental">4.0.9</Version> <Experimental />
77

88
::: warning
99
This is an advanced API. As a user, you most likely want to use [test annotations](/guide/test-annotations) to add notes or context to your tests instead. This is primarily used internally and by library authors.
@@ -25,7 +25,7 @@ Vitest automatically manages attachment serialization (files are copied to [`att
2525

2626
## API
2727

28-
### `recordArtifact` <Badge type="warning">experimental</Badge> {#recordartifact}
28+
### `recordArtifact` <Experimental /> {#recordartifact}
2929

3030
::: warning
3131
`recordArtifact` is an experimental API. Breaking changes might not follow SemVer, please pin Vitest's version when using it.
@@ -49,7 +49,7 @@ Note: annotations, [even though they're built on top of this feature](#relations
4949

5050
The `TestArtifact` type is a union containing all artifacts Vitest can produce, including custom ones. All artifacts extend from [`TestArtifactBase`](#testartifactbase)
5151

52-
### `TestArtifactBase` <Badge type="warning">experimental</Badge> {#testartifactbase}
52+
### `TestArtifactBase` <Experimental /> {#testartifactbase}
5353

5454
```ts
5555
export interface TestArtifactBase {

docs/api/advanced/reporters.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Vitest has its own test run lifecycle. These are represented by reporter's metho
1616
- [`onHookEnd(beforeAll)`](#onhookend)
1717
- [`onTestCaseReady`](#ontestcaseready)
1818
- [`onTestAnnotate`](#ontestannotate) <Version>3.2.0</Version>
19-
- [`onTestCaseArtifactRecord`](#ontestcaseartifactrecord) <Version>4.0.9</Version>
19+
- [`onTestCaseArtifactRecord`](#ontestcaseartifactrecord) <Version type="experimental">4.0.9</Version>
2020
- [`onHookStart(beforeEach)`](#onhookstart)
2121
- [`onHookEnd(beforeEach)`](#onhookend)
2222
- [`onHookStart(afterEach)`](#onhookstart)
@@ -334,7 +334,7 @@ The `onTestAnnotate` hook is associated with the [`context.annotate`](/guide/tes
334334

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

337-
## onTestCaseArtifactRecord <Version>4.0.9</Version> {#ontestcaseartifactrecord}
337+
## onTestCaseArtifactRecord <Version type="experimental">4.0.9</Version> {#ontestcaseartifactrecord}
338338

339339
```ts
340340
function onTestCaseArtifactRecord(
@@ -346,3 +346,5 @@ function onTestCaseArtifactRecord(
346346
The `onTestCaseArtifactRecord` hook is associated with the [`recordArtifact`](/api/advanced/artifacts#recordartifact) utility. When `recordArtifact` is invoked, Vitest serialises it and sends the same attachment to the main thread where reporter can interact with it.
347347

348348
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.
349+
350+
Note: annotations, [even though they're built on top of this feature](/api/advanced/artifacts#relationship-with-annotations), won't hit this hook and won't appear in the `task.artifacts` array for backwards compatibility reasons until the next major version.

0 commit comments

Comments
 (0)