Skip to content

Commit 1f9664d

Browse files
authored
chore(deps): update vitest monorepo to v3 (major) (#6403)
* chore(deps): update vitest monorepo to v3 (major) * test: update snapshot tests * test: coerce error type * test: update vitest notation for object comparison * test: use partial object matching with toMatchObject
1 parent 2609817 commit 1f9664d

File tree

21 files changed

+5466
-703
lines changed

21 files changed

+5466
-703
lines changed

package-lock.json

Lines changed: 5356 additions & 593 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/build-info/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@
5959
"@playwright/test": "^1.30.0",
6060
"@types/node": "^18.0.0",
6161
"@types/semver": "^7.3.13",
62-
"@vitest/ui": "^0.34.0",
62+
"@vitest/ui": "^3.0.0",
6363
"execa": "^8.0.0",
6464
"memfs": "^4.0.0",
6565
"typescript": "^5.0.0",
6666
"unionfs": "^4.4.0",
6767
"vite": "^6.0.0",
68-
"vitest": "^0.34.0"
68+
"vitest": "^3.0.0"
6969
},
7070
"engines": {
7171
"node": ">=18.14.0"

packages/build-info/tests/bin.test.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,23 @@ test('CLI does not print js-workspaces if given a project without it', async (ct
4242
const { stdout } = await runBinary(fixture.cwd)
4343
expect(stdout).toMatchInlineSnapshot(`
4444
"{
45-
\\"frameworks\\": [],
46-
\\"settings\\": [],
47-
\\"langRuntimes\\": [
45+
"frameworks": [],
46+
"settings": [],
47+
"langRuntimes": [
4848
{
49-
\\"id\\": \\"node\\",
50-
\\"name\\": \\"NodeJS\\"
49+
"id": "node",
50+
"name": "NodeJS"
5151
}
5252
],
53-
\\"buildSystems\\": [],
54-
\\"packageManager\\": {
55-
\\"name\\": \\"pnpm\\",
56-
\\"installCommand\\": \\"pnpm install\\",
57-
\\"runCommand\\": \\"pnpm run\\",
58-
\\"lockFiles\\": [
59-
\\"pnpm-lock.yaml\\"
53+
"buildSystems": [],
54+
"packageManager": {
55+
"name": "pnpm",
56+
"installCommand": "pnpm install",
57+
"runCommand": "pnpm run",
58+
"lockFiles": [
59+
"pnpm-lock.yaml"
6060
],
61-
\\"forceEnvironment\\": \\"NETLIFY_USE_PNPM\\"
61+
"forceEnvironment": "NETLIFY_USE_PNPM"
6262
}
6363
}"
6464
`)

packages/build/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
"sinon": "^20.0.0",
143143
"tmp-promise": "^3.0.2",
144144
"tsd": "^0.32.0",
145-
"vitest": "^0.34.0",
145+
"vitest": "^3.0.0",
146146
"yarn": "^1.22.22"
147147
},
148148
"peerDependencies": {

packages/cache-utils/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"@types/node": "^18.0.0",
6464
"tmp-promise": "^3.0.0",
6565
"typescript": "^5.0.0",
66-
"vitest": "^0.34.0"
66+
"vitest": "^3.0.0"
6767
},
6868
"engines": {
6969
"node": ">=18.14.0"

packages/edge-bundler/node/downloader.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ test('fails downloading binary after 4th time', async (ctx: TestContext) => {
119119
try {
120120
await download(ctx.tmpDir, `^${version}`, testLogger)
121121
} catch (error) {
122-
expect(error).toMatch(/Download failed with status code 500/)
122+
expect((error as Error).message).toMatch(/Download failed with status code 500/)
123123
}
124124

125125
expect(latestVersionMock.isDone()).toBe(true)
@@ -158,7 +158,7 @@ test('fails downloading if response stream throws error', async (ctx: TestContex
158158
try {
159159
await download(ctx.tmpDir, `^${version}`, testLogger)
160160
} catch (error) {
161-
expect(error).toMatch(/stream error/)
161+
expect((error as Error).message).toMatch(/stream error/)
162162
}
163163

164164
expect(latestVersionMock.isDone()).toBe(true)
Lines changed: 70 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,191 +1,191 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

33
exports[`bundle > should throw on additional property in bundle 1`] = `
4-
"Validation of Edge Functions manifest failed
4+
[ManifestValidationError: Validation of Edge Functions manifest failed
55
ADDTIONAL PROPERTY must NOT have additional properties
66
7-
4 | \\"asset\\": \\"f35baff44129a8f6be7db68590b2efd86ed4ba29000e2edbcaddc5d620d7d043.js\\",
8-
5 | \\"format\\": \\"js\\",
9-
> 6 | \\"foo\\": \\"bar\\"
7+
4 | "asset": "f35baff44129a8f6be7db68590b2efd86ed4ba29000e2edbcaddc5d620d7d043.js",
8+
5 | "format": "js",
9+
> 6 | "foo": "bar"
1010
| ^^^^^ 😲 foo is not expected to be here!
1111
7 | }
1212
8 | ],
13-
9 | \\"routes\\": ["
13+
9 | "routes": []
1414
`;
1515

1616
exports[`bundle > should throw on invalid format 1`] = `
17-
"Validation of Edge Functions manifest failed
17+
[ManifestValidationError: Validation of Edge Functions manifest failed
1818
ENUM must be equal to one of the allowed values
1919
(eszip2, js)
2020
2121
3 | {
22-
4 | \\"asset\\": \\"f35baff44129a8f6be7db68590b2efd86ed4ba29000e2edbcaddc5d620d7d043.js\\",
23-
> 5 | \\"format\\": \\"foo\\"
22+
4 | "asset": "f35baff44129a8f6be7db68590b2efd86ed4ba29000e2edbcaddc5d620d7d043.js",
23+
> 5 | "format": "foo"
2424
| ^^^^^ 👈🏽 Unexpected value, should be equal to one of the allowed values
2525
6 | }
2626
7 | ],
27-
8 | \\"routes\\": ["
27+
8 | "routes": []
2828
`;
2929

3030
exports[`bundle > should throw on missing asset 1`] = `
31-
"Validation of Edge Functions manifest failed
31+
[ManifestValidationError: Validation of Edge Functions manifest failed
3232
REQUIRED must have required property 'asset'
3333
3434
1 | {
35-
2 | \\"bundles\\": [
35+
2 | "bundles": [
3636
> 3 | {
3737
| ^ ☹️ asset is missing here!
38-
4 | \\"format\\": \\"js\\"
38+
4 | "format": "js"
3939
5 | }
40-
6 | ],"
40+
6 | ],]
4141
`;
4242
4343
exports[`bundle > should throw on missing format 1`] = `
44-
"Validation of Edge Functions manifest failed
44+
[ManifestValidationError: Validation of Edge Functions manifest failed
4545
REQUIRED must have required property 'format'
4646
4747
1 | {
48-
2 | \\"bundles\\": [
48+
2 | "bundles": [
4949
> 3 | {
5050
| ^ ☹️ format is missing here!
51-
4 | \\"asset\\": \\"f35baff44129a8f6be7db68590b2efd86ed4ba29000e2edbcaddc5d620d7d043.js\\"
51+
4 | "asset": "f35baff44129a8f6be7db68590b2efd86ed4ba29000e2edbcaddc5d620d7d043.js"
5252
5 | }
53-
6 | ],"
53+
6 | ],]
5454
`;
5555
5656
exports[`import map URL > should throw on wrong type 1`] = `
57-
"Validation of Edge Functions manifest failed
57+
[ManifestValidationError: Validation of Edge Functions manifest failed
5858
TYPE must be string
5959
6060
30 | ],
61-
31 | \\"bundler_version\\": \\"1.6.0\\",
62-
> 32 | \\"import_map\\": [
61+
31 | "bundler_version": "1.6.0",
62+
> 32 | "import_map": [
6363
| ^
64-
> 33 | \\"file:///root/.netlify/edge-functions-dist/import_map.json\\"
64+
> 33 | "file:///root/.netlify/edge-functions-dist/import_map.json"
6565
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6666
> 34 | ]
6767
| ^^^^ 👈🏽 type must be string
68-
35 | }"
68+
35 | }]
6969
`;
7070
7171
exports[`layers > should throw on additional property 1`] = `
72-
"Validation of Edge Functions manifest failed
72+
[ManifestValidationError: Validation of Edge Functions manifest failed
7373
ADDTIONAL PROPERTY must NOT have additional properties
7474
75-
27 | \\"name\\": \\"name\\",
76-
28 | \\"local\\": \\"local\\",
77-
> 29 | \\"foo\\": \\"bar\\"
75+
27 | "name": "name",
76+
28 | "local": "local",
77+
> 29 | "foo": "bar"
7878
| ^^^^^ 😲 foo is not expected to be here!
7979
30 | }
8080
31 | ],
81-
32 | \\"bundler_version\\": \\"1.6.0\\""
81+
32 | "bundler_version": "1.6.0"]
8282
`;
8383
8484
exports[`layers > should throw on missing flag 1`] = `
85-
"Validation of Edge Functions manifest failed
85+
[ManifestValidationError: Validation of Edge Functions manifest failed
8686
REQUIRED must have required property 'flag'
8787
8888
23 | ],
89-
24 | \\"layers\\": [
89+
24 | "layers": [
9090
> 25 | {
9191
| ^ ☹️ flag is missing here!
92-
26 | \\"name\\": \\"name\\",
93-
27 | \\"local\\": \\"local\\"
94-
28 | }"
92+
26 | "name": "name",
93+
27 | "local": "local"
94+
28 | }]
9595
`;
9696
9797
exports[`layers > should throw on missing name 1`] = `
98-
"Validation of Edge Functions manifest failed
98+
[ManifestValidationError: Validation of Edge Functions manifest failed
9999
REQUIRED must have required property 'name'
100100
101101
23 | ],
102-
24 | \\"layers\\": [
102+
24 | "layers": [
103103
> 25 | {
104104
| ^ ☹️ name is missing here!
105-
26 | \\"flag\\": \\"flag\\",
106-
27 | \\"local\\": \\"local\\"
107-
28 | }"
105+
26 | "flag": "flag",
106+
27 | "local": "local"
107+
28 | }]
108108
`;
109109
110110
exports[`route > should throw on additional property 1`] = `
111-
"Validation of Edge Functions manifest failed
111+
[ManifestValidationError: Validation of Edge Functions manifest failed
112112
ADDTIONAL PROPERTY must NOT have additional properties
113113
114-
12 | \\"pattern\\": \\"^/hello/?$\\",
115-
13 | \\"generator\\": \\"@netlify/[email protected]\\",
116-
> 14 | \\"foo\\": \\"bar\\"
114+
12 | "pattern": "^/hello/?$",
115+
13 | "generator": "@netlify/[email protected]",
116+
> 14 | "foo": "bar"
117117
| ^^^^^ 😲 foo is not expected to be here!
118118
15 | }
119119
16 | ],
120-
17 | \\"post_cache_routes\\": ["
120+
17 | "post_cache_routes": []
121121
`;
122122
123123
exports[`route > should throw on invalid pattern 1`] = `
124-
"Validation of Edge Functions manifest failed
124+
[ManifestValidationError: Validation of Edge Functions manifest failed
125125
FORMAT pattern must be a regex that starts with ^ and ends with $ (e.g. ^/blog/[d]{4}$)
126126
127-
10 | \\"name\\": \\"name\\",
128-
11 | \\"function\\": \\"hello\\",
129-
> 12 | \\"pattern\\": \\"/^/hello/?$/\\",
127+
10 | "name": "name",
128+
11 | "function": "hello",
129+
> 12 | "pattern": "/^/hello/?$/",
130130
| ^^^^^^^^^^^^^^ 👈🏽 format pattern must be a regex that starts with ^ and ends with $ (e.g. ^/blog/[d]{4}$)
131-
13 | \\"generator\\": \\"@netlify/[email protected]\\"
131+
13 | "generator": "@netlify/[email protected]"
132132
14 | }
133-
15 | ],"
133+
15 | ],]
134134
`;
135135
136136
exports[`route > should throw on missing function 1`] = `
137-
"Validation of Edge Functions manifest failed
137+
[ManifestValidationError: Validation of Edge Functions manifest failed
138138
REQUIRED must have required property 'function'
139139
140140
7 | ],
141-
8 | \\"routes\\": [
141+
8 | "routes": [
142142
> 9 | {
143143
| ^ ☹️ function is missing here!
144-
10 | \\"name\\": \\"name\\",
145-
11 | \\"pattern\\": \\"^/hello/?$\\",
146-
12 | \\"generator\\": \\"@netlify/[email protected]\\""
144+
10 | "name": "name",
145+
11 | "pattern": "^/hello/?$",
146+
12 | "generator": "@netlify/[email protected]"]
147147
`;
148148
149149
exports[`route > should throw on missing pattern 1`] = `
150-
"Validation of Edge Functions manifest failed
150+
[ManifestValidationError: Validation of Edge Functions manifest failed
151151
REQUIRED must have required property 'pattern'
152152
153153
7 | ],
154-
8 | \\"routes\\": [
154+
8 | "routes": [
155155
> 9 | {
156156
| ^ ☹️ pattern is missing here!
157-
10 | \\"name\\": \\"name\\",
158-
11 | \\"function\\": \\"hello\\",
159-
12 | \\"generator\\": \\"@netlify/[email protected]\\""
157+
10 | "name": "name",
158+
11 | "function": "hello",
159+
12 | "generator": "@netlify/[email protected]"]
160160
`;
161161
162162
exports[`should show multiple errors 1`] = `
163-
"Validation of Edge Functions manifest failed
163+
[ManifestValidationError: Validation of Edge Functions manifest failed
164164
ADDTIONAL PROPERTY must NOT have additional properties
165165
166166
30 | ],
167-
31 | \\"bundler_version\\": \\"1.6.0\\",
168-
> 32 | \\"foo\\": \\"bar\\",
167+
31 | "bundler_version": "1.6.0",
168+
> 32 | "foo": "bar",
169169
| ^^^^^ 😲 foo is not expected to be here!
170-
33 | \\"baz\\": \\"bar\\"
170+
33 | "baz": "bar"
171171
34 | }
172172
173173
ADDTIONAL PROPERTY must NOT have additional properties
174174
175-
31 | \\"bundler_version\\": \\"1.6.0\\",
176-
32 | \\"foo\\": \\"bar\\",
177-
> 33 | \\"baz\\": \\"bar\\"
175+
31 | "bundler_version": "1.6.0",
176+
32 | "foo": "bar",
177+
> 33 | "baz": "bar"
178178
| ^^^^^ 😲 baz is not expected to be here!
179-
34 | }"
179+
34 | }]
180180
`;
181181
182182
exports[`should throw on additional property on root level 1`] = `
183-
"Validation of Edge Functions manifest failed
183+
[ManifestValidationError: Validation of Edge Functions manifest failed
184184
ADDTIONAL PROPERTY must NOT have additional properties
185185
186186
30 | ],
187-
31 | \\"bundler_version\\": \\"1.6.0\\",
188-
> 32 | \\"foo\\": \\"bar\\"
187+
31 | "bundler_version": "1.6.0",
188+
> 32 | "foo": "bar"
189189
| ^^^^^ 😲 foo is not expected to be here!
190-
33 | }"
190+
33 | }]
191191
`;

packages/edge-bundler/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@
4545
"@types/node": "^18.0.0",
4646
"@types/semver": "^7.3.9",
4747
"@types/uuid": "^10.0.0",
48-
"@vitest/coverage-v8": "^0.34.0",
48+
"@vitest/coverage-v8": "^3.0.0",
4949
"archiver": "^7.0.0",
5050
"chalk": "^5.4.0",
5151
"nock": "^14.0.0",
5252
"npm-run-all2": "^6.0.0",
5353
"tar": "^7.0.0",
5454
"typescript": "^5.0.0",
55-
"vitest": "^0.34.0"
55+
"vitest": "^3.0.0"
5656
},
5757
"engines": {
5858
"node": ">=18.14.0"

packages/framework-info/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"tmp-promise": "^3.0.2",
7979
"typescript": "^5.0.0",
8080
"vite": "^6.0.0",
81-
"vitest": "^0.34.0"
81+
"vitest": "^3.0.0"
8282
},
8383
"engines": {
8484
"node": ">=18.14.0"

packages/functions-utils/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@
5555
"path-exists": "^5.0.0"
5656
},
5757
"devDependencies": {
58-
"@types/node": "^14.18.53",
58+
"@types/node": "^18.0.0",
5959
"sort-on": "^6.0.0",
6060
"tmp-promise": "^3.0.0",
6161
"typescript": "^5.0.0",
62-
"vitest": "^0.34.0"
62+
"vitest": "^3.0.0"
6363
},
6464
"engines": {
6565
"node": ">=18.14.0"

0 commit comments

Comments
 (0)