Skip to content

Commit 702575e

Browse files
authored
chore: upgrade to vitest 3 (#13330)
* chore: upgrade to vitest 3 * increase timeout * more timeout * more * more * more
1 parent 537cd1b commit 702575e

File tree

16 files changed

+489
-467
lines changed

16 files changed

+489
-467
lines changed

packages/adapter-auto/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"@sveltejs/vite-plugin-svelte": "^5.0.1",
4545
"@types/node": "^18.19.48",
4646
"typescript": "^5.3.3",
47-
"vitest": "^2.1.6"
47+
"vitest": "^3.0.1"
4848
},
4949
"dependencies": {
5050
"import-meta-resolve": "^4.1.0"

packages/adapter-netlify/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"@types/set-cookie-parser": "^2.4.7",
5757
"rollup": "^4.14.2",
5858
"typescript": "^5.3.3",
59-
"vitest": "^2.1.6"
59+
"vitest": "^3.0.1"
6060
},
6161
"peerDependencies": {
6262
"@sveltejs/kit": "^2.4.0"

packages/adapter-node/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"polka": "^1.0.0-next.28",
5050
"sirv": "^3.0.0",
5151
"typescript": "^5.3.3",
52-
"vitest": "^2.1.6"
52+
"vitest": "^3.0.1"
5353
},
5454
"dependencies": {
5555
"@rollup/plugin-commonjs": "^28.0.1",

packages/adapter-vercel/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"@sveltejs/vite-plugin-svelte": "^5.0.1",
4949
"@types/node": "^18.19.48",
5050
"typescript": "^5.3.3",
51-
"vitest": "^2.1.6"
51+
"vitest": "^3.0.1"
5252
},
5353
"peerDependencies": {
5454
"@sveltejs/kit": "^2.4.0"

packages/enhanced-img/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"svelte": "^5.2.9",
5050
"typescript": "^5.6.3",
5151
"vite": "^6.0.1",
52-
"vitest": "^2.1.6"
52+
"vitest": "^3.0.1"
5353
},
5454
"peerDependencies": {
5555
"svelte": "^5.0.0",

packages/kit/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"svelte-preprocess": "^6.0.0",
4343
"typescript": "^5.3.3",
4444
"vite": "^6.0.1",
45-
"vitest": "^2.1.6"
45+
"vitest": "^3.0.1"
4646
},
4747
"peerDependencies": {
4848
"@sveltejs/vite-plugin-svelte": "^3.0.0 || ^4.0.0-next.1 || ^5.0.0",

packages/kit/src/core/sync/write_types/index.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function run_test(dir) {
2929
write_all_types(initial, manifest);
3030
}
3131

32-
test('Creates correct $types', () => {
32+
test('Creates correct $types', { timeout: 6000 }, () => {
3333
// To save us from creating a real SvelteKit project for each of the tests,
3434
// we first run the type generation directly for each test case, and then
3535
// call `tsc` to check that the generated types are valid.

packages/kit/test/build-errors/env.spec.js

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,55 +3,57 @@ import { execSync } from 'node:child_process';
33
import path from 'node:path';
44
import process from 'node:process';
55

6-
test('$env/dynamic/private is not statically importable from the client', () => {
6+
const timeout = 60_000;
7+
8+
test('$env/dynamic/private is not statically importable from the client', { timeout }, () => {
79
assert.throws(
810
() =>
911
execSync('pnpm build', {
1012
cwd: path.join(process.cwd(), 'apps/private-dynamic-env'),
1113
stdio: 'pipe',
12-
timeout: 60000
14+
timeout
1315
}),
1416
/.*Cannot import \$env\/dynamic\/private into client-side code:.*/gs
1517
);
1618
});
1719

18-
test('$env/dynamic/private is not dynamically importable from the client', () => {
20+
test('$env/dynamic/private is not dynamically importable from the client', { timeout }, () => {
1921
assert.throws(
2022
() =>
2123
execSync('pnpm build', {
2224
cwd: path.join(process.cwd(), 'apps/private-dynamic-env-dynamic-import'),
2325
stdio: 'pipe',
24-
timeout: 60000
26+
timeout
2527
}),
2628
/.*Cannot import \$env\/dynamic\/private into client-side code:.*/gs
2729
);
2830
});
2931

30-
test('$env/static/private is not statically importable from the client', () => {
32+
test('$env/static/private is not statically importable from the client', { timeout }, () => {
3133
assert.throws(
3234
() =>
3335
execSync('pnpm build', {
3436
cwd: path.join(process.cwd(), 'apps/private-static-env'),
3537
stdio: 'pipe',
36-
timeout: 60000
38+
timeout
3739
}),
3840
/.*Cannot import \$env\/static\/private into client-side code:.*/gs
3941
);
4042
});
4143

42-
test('$env/static/private is not dynamically importable from the client', () => {
44+
test('$env/static/private is not dynamically importable from the client', { timeout }, () => {
4345
assert.throws(
4446
() =>
4547
execSync('pnpm build', {
4648
cwd: path.join(process.cwd(), 'apps/private-static-env-dynamic-import'),
4749
stdio: 'pipe',
48-
timeout: 60000
50+
timeout
4951
}),
5052
/.*Cannot import \$env\/static\/private into client-side code:.*/gs
5153
);
5254
});
5355

54-
test('$env/dynamic/private is not importable from the service worker', () => {
56+
test('$env/dynamic/private is not importable from the service worker', { timeout }, () => {
5557
assert.throws(
5658
() =>
5759
execSync('pnpm build', {
@@ -63,13 +65,13 @@ test('$env/dynamic/private is not importable from the service worker', () => {
6365
);
6466
});
6567

66-
test('$env/dynamic/public is not importable from the service worker', () => {
68+
test('$env/dynamic/public is not importable from the service worker', { timeout }, () => {
6769
assert.throws(
6870
() =>
6971
execSync('pnpm build', {
7072
cwd: path.join(process.cwd(), 'apps/service-worker-dynamic-public-env'),
7173
stdio: 'pipe',
72-
timeout: 60000
74+
timeout
7375
}),
7476
/.*Cannot import \$env\/dynamic\/public into service-worker code.*/gs
7577
);

packages/kit/test/build-errors/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
},
99
"type": "module",
1010
"devDependencies": {
11-
"vitest": "^2.1.6"
11+
"vitest": "^3.0.1"
1212
}
1313
}

packages/kit/test/build-errors/prerender.spec.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,27 @@ import path from 'node:path';
44
import { EOL } from 'node:os';
55
import process from 'node:process';
66

7-
test('prerenderable routes must be prerendered', () => {
7+
const timeout = 60_000;
8+
9+
test('prerenderable routes must be prerendered', { timeout }, () => {
810
assert.throws(
911
() =>
1012
execSync('pnpm build', {
1113
cwd: path.join(process.cwd(), 'apps/prerenderable-not-prerendered'),
1214
stdio: 'pipe',
13-
timeout: 60000
15+
timeout
1416
}),
1517
/The following routes were marked as prerenderable, but were not prerendered because they were not found while crawling your app:\r?\n {2}- \/\[x\]/gs
1618
);
1719
});
1820

19-
test('entry generators should match their own route', () => {
21+
test('entry generators should match their own route', { timeout }, () => {
2022
assert.throws(
2123
() =>
2224
execSync('pnpm build', {
2325
cwd: path.join(process.cwd(), 'apps/prerender-entry-generator-mismatch'),
2426
stdio: 'pipe',
25-
timeout: 60000
27+
timeout
2628
}),
2729
`Error: The entries export from /[slug]/[notSpecific] generated entry /whatever/specific, which was matched by /[slug]/specific - see the \`handleEntryGeneratorMismatch\` option in https://svelte.dev/docs/kit/configuration#prerender for more info.${EOL}To suppress or handle this error, implement \`handleEntryGeneratorMismatch\` in https://svelte.dev/docs/kit/configuration#prerender`
2830
);

packages/kit/test/build-errors/server-only.spec.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ import { execSync } from 'node:child_process';
33
import path from 'node:path';
44
import process from 'node:process';
55

6-
test('$lib/*.server.* is not statically importable from the client', () => {
6+
const timeout = 60_000;
7+
8+
test('$lib/*.server.* is not statically importable from the client', { timeout }, () => {
79
try {
810
execSync('pnpm build', {
911
cwd: path.join(process.cwd(), 'apps/server-only-module'),
1012
stdio: 'pipe',
11-
timeout: 60000
13+
timeout
1214
});
1315
} catch (err) {
1416
assert.ok(
@@ -20,12 +22,12 @@ test('$lib/*.server.* is not statically importable from the client', () => {
2022
throw new Error();
2123
});
2224

23-
test('$lib/*.server.* is not dynamically importable from the client', () => {
25+
test('$lib/*.server.* is not dynamically importable from the client', { timeout }, () => {
2426
try {
2527
execSync('pnpm build', {
2628
cwd: path.join(process.cwd(), 'apps/server-only-module-dynamic-import'),
2729
stdio: 'pipe',
28-
timeout: 60000
30+
timeout
2931
});
3032
} catch (err) {
3133
assert.ok(
@@ -37,12 +39,12 @@ test('$lib/*.server.* is not dynamically importable from the client', () => {
3739
throw new Error();
3840
});
3941

40-
test('$lib/server/* is not statically importable from the client', () => {
42+
test('$lib/server/* is not statically importable from the client', { timeout }, () => {
4143
try {
4244
execSync('pnpm build', {
4345
cwd: path.join(process.cwd(), 'apps/server-only-folder'),
4446
stdio: 'pipe',
45-
timeout: 60000
47+
timeout
4648
});
4749
} catch (err) {
4850
assert.ok(
@@ -54,12 +56,12 @@ test('$lib/server/* is not statically importable from the client', () => {
5456
throw new Error();
5557
});
5658

57-
test('$lib/server/* is not dynamically importable from the client', () => {
59+
test('$lib/server/* is not dynamically importable from the client', { timeout }, () => {
5860
try {
5961
execSync('pnpm build', {
6062
cwd: path.join(process.cwd(), 'apps/server-only-folder-dynamic-import'),
6163
stdio: 'pipe',
62-
timeout: 60000
64+
timeout
6365
});
6466
} catch (err) {
6567
assert.ok(

packages/kit/test/build-errors/syntax-error.spec.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ import { execSync } from 'node:child_process';
33
import path from 'node:path';
44
import process from 'node:process';
55

6-
test('$lib/*.server.* is not statically importable from the client', () => {
6+
const timeout = 60_000;
7+
8+
test('$lib/*.server.* is not statically importable from the client', { timeout }, () => {
79
try {
810
execSync('pnpm build', {
911
cwd: path.join(process.cwd(), 'apps/syntax-error'),
1012
stdio: 'pipe',
11-
timeout: 60000
13+
timeout
1214
});
1315
} catch (err) {
1416
assert.ok(

packages/kit/test/prerendering/basics/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"svelte-check": "^4.1.1",
1818
"typescript": "^5.5.4",
1919
"vite": "^6.0.1",
20-
"vitest": "^2.1.6"
20+
"vitest": "^3.0.1"
2121
},
2222
"type": "module"
2323
}

packages/kit/test/prerendering/options/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"svelte-check": "^4.1.1",
1717
"typescript": "^5.5.4",
1818
"vite": "^6.0.1",
19-
"vitest": "^2.1.6"
19+
"vitest": "^3.0.1"
2020
},
2121
"type": "module"
2222
}

packages/kit/test/prerendering/paths-base/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"svelte-check": "^4.1.1",
1717
"typescript": "^5.5.4",
1818
"vite": "^6.0.1",
19-
"vitest": "^2.1.6"
19+
"vitest": "^3.0.1"
2020
},
2121
"type": "module"
2222
}

0 commit comments

Comments
 (0)