You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide/migration.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -174,6 +174,14 @@ Vitest no longer serves the browser orchestrator UI from a bare `/__vitest_test_
174
174
175
175
If you manually opened the browser preview by copying the Vite server URL or visiting `/__vitest_test__/` directly, use the URL opened or printed by Vitest instead.
176
176
177
+
### Generated Reports and Artifacts Use the `.vitest` Directory
178
+
179
+
Vitest now uses a single `.vitest` directory at the project root as the shared artifact root, so one `.vitest` entry in `.gitignore` is enough. Defaults that moved this major:
-**Blob reporter** and `--merge-reports`: `.vitest-reports/blob-*.json` → `.vitest/blob/blob-*.json`
183
+
-**HTML reporter** ([`html`](/guide/reporters#html-reporter)): `html/index.html` → `.vitest/index.html`, and its option changed from `outputFile` (a file) to `outputDir` (a directory)
Copy file name to clipboardExpand all lines: docs/guide/reporters.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,7 @@ export default defineConfig({
60
60
61
61
## Reporter Output
62
62
63
-
By default, Vitest's reporters will print their output to the terminal. When using the `json`, `html`or `junit` reporters, you can instead write your tests' output to a file by including an `outputFile`[configuration option](/config/outputfile) either in your Vite configuration file or via CLI.
63
+
By default, Vitest's reporters will print their output to the terminal. When using the `json`or `junit` reporters, you can instead write your tests' output to a file by including an `outputFile`[configuration option](/config/outputfile) either in your Vite configuration file or via CLI. The `html` reporter writes a report directory instead; see its [`outputDir`](#html-reporter) option.
64
64
65
65
:::code-group
66
66
```bash [CLI]
@@ -506,7 +506,7 @@ export default defineConfig({
506
506
507
507
Generates an HTML file to view test results through an interactive [GUI](/guide/ui). After the file has been generated, Vitest will keep a local development server running and provide a link to view the report in a browser.
508
508
509
-
Output file can be specified using the [`outputFile`](/config/outputfile) configuration option. If no `outputFile` option is provided, a new HTML file will be created.
509
+
The report artifact root can be specified using the reporter's `outputDir`option. The report entry is written to `<outputDir>/index.html` and the UI assets files live under `<outputDir>/ui/`. By default `outputDir`is `.vitest`, the shared Vitest artifact directory, so attachments (`.vitest/attachments`) and coverage (`.vitest/coverage`) are reused without being copied.
Copy file name to clipboardExpand all lines: docs/guide/ui.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,10 +51,10 @@ If you still want to see how your tests are running in real time in the terminal
51
51
To preview your HTML report, you can use the [vite preview](https://vitejs.dev/guide/cli.html#vite-preview) command:
52
52
53
53
```sh
54
-
npx vite preview --outDir ./html
54
+
npx vite preview --outDir .vitest
55
55
```
56
56
57
-
You can configure output with [`outputFile`](/config/outputfile) config option. You need to specify `.html` path there. For example, `./html/index.html`is the default value.
57
+
You can configure the output location with the HTML reporter's `outputDir`option. It points to the report artifact root, and the report entry is written to `<outputDir>/index.html`. The default value is `.vitest`, the shared Vitest artifact directory.
58
58
:::
59
59
60
60
If you need a portable report that can be opened or shared as one file, see [`singleFile`](/guide/reporters#html-reporter) in the HTML reporter documentation.
@@ -67,7 +67,7 @@ To view the HTML report from CI, for example in GitHub Actions, upload the outpu
67
67
id: upload-report
68
68
with:
69
69
name: vitest-report
70
-
path: html/
70
+
path: .vitest/
71
71
72
72
- name: Viewer link in summary
73
73
run: echo "[View HTML report](https://viewer.vitest.dev/?url=${{ steps.upload-report.outputs.artifact-url }})" >> $GITHUB_STEP_SUMMARY
@@ -80,7 +80,7 @@ When you use `singleFile: true`, you can upload the report as a single file and
0 commit comments