Skip to content

Commit 1ba7338

Browse files
authored
fix!: default attachmentsDir from .vitest-attachements/ to .vitest/attachments/ (#10186)
1 parent 0c1df24 commit 1ba7338

10 files changed

Lines changed: 20 additions & 20 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ test/cli/fixtures/browser-multiple/basic-*
3333
# exclude static html reporter folder
3434
test/browser/html/
3535
test/core/html/
36-
.vitest-attachments
36+
.vitest
3737
explainFiles.txt
3838
.vitest-dump

docs/config/attachmentsdir.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ outline: deep
66
# attachmentsDir
77

88
- **Type:** `string`
9-
- **Default:** `'.vitest-attachments'`
9+
- **Default:** `'.vitest/attachments'`
1010

1111
Directory path for storing attachments created by [`context.annotate`](/guide/test-context#annotate) relative to the project root.

docs/guide/browser/visual-regression-testing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,10 @@ Reference screenshot:
302302
tests/__screenshots__/button.test.ts/button-chromium-darwin.png
303303
304304
Actual screenshot:
305-
tests/.vitest-attachments/button.test.ts/button-chromium-darwin-actual.png
305+
tests/.vitest/attachments/button.test.ts/button-chromium-darwin-actual.png
306306
307307
Diff image:
308-
tests/.vitest-attachments/button.test.ts/button-chromium-darwin-diff.png
308+
tests/.vitest/attachments/button.test.ts/button-chromium-darwin-diff.png
309309
```
310310

311311
### Understanding the diff image

docs/guide/cli-generated.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ Collect test and suite locations in the `location` property
865865
- **CLI:** `--attachmentsDir <dir>`
866866
- **Config:** [attachmentsDir](/config/attachmentsdir)
867867

868-
The directory where attachments from `context.annotate` are stored in (default: `.vitest-attachments`)
868+
The directory where attachments from `context.annotate` are stored in (default: `.vitest/attachments`)
869869

870870
### run
871871

docs/guide/improving-performance.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ jobs:
178178
uses: actions/upload-artifact@v4
179179
with:
180180
name: blob-attachments-${{ matrix.shardIndex }}
181-
path: .vitest-attachments/**
181+
path: .vitest/**
182182
include-hidden-files: true
183183
retention-days: 1
184184

@@ -209,7 +209,7 @@ jobs:
209209
- name: Download attachments from GitHub Actions Artifacts
210210
uses: actions/download-artifact@v4
211211
with:
212-
path: .vitest-attachments
212+
path: .vitest
213213
pattern: blob-attachments-*
214214
merge-multiple: true
215215

packages/vitest/src/node/cli/cli-config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ export const cliOptionsConfig: VitestCLIOptions = {
821821
description: 'Collect test and suite locations in the `location` property',
822822
},
823823
attachmentsDir: {
824-
description: 'The directory where attachments from `context.annotate` are stored in (default: `.vitest-attachments`)',
824+
description: 'The directory where attachments from `context.annotate` are stored in (default: `.vitest/attachments`)',
825825
argument: '<dir>',
826826
},
827827

packages/vitest/src/node/config/resolveConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ export function resolveConfig(
568568

569569
resolved.attachmentsDir = resolve(
570570
resolved.root,
571-
resolved.attachmentsDir ?? '.vitest-attachments',
571+
resolved.attachmentsDir ?? '.vitest/attachments',
572572
)
573573

574574
if (resolved.snapshotEnvironment) {

packages/vitest/src/node/types/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ export interface InlineConfig {
860860
/**
861861
* Directory path for storing attachments created by `context.annotate`
862862
*
863-
* @default '.vitest-attachments'
863+
* @default '.vitest/attachments'
864864
*/
865865
attachmentsDir?: string
866866

test/cli/test/annotations.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ describe('API', () => {
108108
"[ready] simple",
109109
"[annotate] simple 1 notice path=undefined contentType=undefined body=undefined",
110110
"[annotate] simple 2 warning path=undefined contentType=undefined body=undefined",
111-
"[annotate] simple 3 notice path=<root>/.vitest-attachments/3-<hash>.js contentType=text/javascript body=undefined",
112-
"[annotate] simple 4 warning path=<root>/.vitest-attachments/4-<hash>.js contentType=text/javascript body=undefined",
111+
"[annotate] simple 3 notice path=<root>/.vitest/attachments/3-<hash>.js contentType=text/javascript body=undefined",
112+
"[annotate] simple 4 warning path=<root>/.vitest/attachments/4-<hash>.js contentType=text/javascript body=undefined",
113113
"[annotate] simple external notice path=undefined contentType=undefined body=undefined",
114114
"[annotate] simple with base64 body notice path=undefined contentType=undefined body=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
115115
"[annotate] simple with Uint8Array body notice path=undefined contentType=undefined body=AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/w==",
@@ -177,7 +177,7 @@ describe('API', () => {
177177
{
178178
"attachment": {
179179
"contentType": "text/javascript",
180-
"path": "<root>/.vitest-attachments/3-<hash>.js",
180+
"path": "<root>/.vitest/attachments/3-<hash>.js",
181181
},
182182
"location": {
183183
"column": 9,
@@ -190,7 +190,7 @@ describe('API', () => {
190190
{
191191
"attachment": {
192192
"contentType": "text/javascript",
193-
"path": "<root>/.vitest-attachments/4-<hash>.js",
193+
"path": "<root>/.vitest/attachments/4-<hash>.js",
194194
},
195195
"location": {
196196
"column": 9,

test/cli/test/artifacts.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ describe('API', () => {
108108
[
109109
"[ready] simple",
110110
"[artifact] simple with-no-attachments path=undefined contentType=undefined body=undefined",
111-
"[artifact] simple with-one-attachment path=[ '<root>/.vitest-attachments/<hash>.js' ] contentType=[ 'text/javascript' ] body=[ undefined ]",
111+
"[artifact] simple with-one-attachment path=[ '<root>/.vitest/attachments/<hash>.js' ] contentType=[ 'text/javascript' ] body=[ undefined ]",
112112
"[artifact] simple with-multiple-attachments path=[
113-
'<root>/.vitest-attachments/<hash>.js',
114-
'<root>/.vitest-attachments/<hash>.js'
113+
'<root>/.vitest/attachments/<hash>.js',
114+
'<root>/.vitest/attachments/<hash>.js'
115115
] contentType=[ 'text/javascript', 'text/javascript' ] body=[ undefined, undefined ]",
116116
"[artifact] simple external path=undefined contentType=undefined body=undefined",
117117
"[artifact] simple with-base64 path=[ undefined ] contentType=[ undefined ] body=[ 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' ]",
@@ -156,7 +156,7 @@ describe('API', () => {
156156
"attachments": [
157157
{
158158
"contentType": "text/javascript",
159-
"path": "<root>/.vitest-attachments/<hash>.js",
159+
"path": "<root>/.vitest/attachments/<hash>.js",
160160
},
161161
],
162162
"location": {
@@ -170,11 +170,11 @@ describe('API', () => {
170170
"attachments": [
171171
{
172172
"contentType": "text/javascript",
173-
"path": "<root>/.vitest-attachments/<hash>.js",
173+
"path": "<root>/.vitest/attachments/<hash>.js",
174174
},
175175
{
176176
"contentType": "text/javascript",
177-
"path": "<root>/.vitest-attachments/<hash>.js",
177+
"path": "<root>/.vitest/attachments/<hash>.js",
178178
},
179179
],
180180
"location": {

0 commit comments

Comments
 (0)