Skip to content

Commit 21d4352

Browse files
chore(deps): upgrade vitest to 3.2.4, vite to 7, codspeed plugin to 5.4
Vitest 2 → 3 upgrade lets us restore @codspeed/vitest-plugin to ^5.4.0, which is required for the plugin to enumerate individual benchmark tasks under Vitest's runner (4.x silently emitted empty results on Vitest 2.x). Config migrations: - drop removed `transformMode` and `deps.registerNodeLoader` options - replace `threads: false, isolate: false` with `pool: "threads"` (forks+singleFork+no-isolate accumulates all 41 test files' state in one Node process and OOMs at 4 GB; threads pool retains v2 semantics) Test fix: - `tests/createErrorBoundary.test.ts`: two assertions used `.toThrow(error)` with an Error instance and relied on Vitest 2's loose message-only matching. Vitest 3 does a structural diff, so the StatusError wrapper no longer satisfies an Error expectation. Tests now catch the throw directly and assert `caught.cause ?? caught === error`, which is what the test intent really was. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 34a41cb commit 21d4352

11 files changed

Lines changed: 418 additions & 287 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"@rollup/plugin-node-resolve": "^15.0.1",
3636
"@rollup/plugin-replace": "^5.0.2",
3737
"@types/node": "^22.7.5",
38-
"@vitest/coverage-v8": "^2.1.2",
38+
"@vitest/coverage-v8": "^3.2.4",
3939
"babel-plugin-jsx-dom-expressions": "0.50.0-next.8",
4040
"babel-plugin-transform-rename-import": "^2.3.0",
4141
"coveralls": "^3.1.1",
@@ -58,7 +58,7 @@
5858
"turbo": "^2.0.0",
5959
"typescript": "~5.7.2",
6060
"vite-plugin-solid": "3.0.0-next.4",
61-
"vitest": "^2.1.2"
61+
"vitest": "^3.2.4"
6262
},
6363
"simple-git-hooks": {
6464
"pre-commit": "pnpm run format"

packages/solid-h/vite.config.mjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ import { defineConfig } from "vitest/config";
55
export default defineConfig({
66
test: {
77
environment: "jsdom",
8-
deps: { registerNodeLoader: true },
9-
threads: false,
10-
isolate: false,
8+
pool: "threads",
119
globals: true,
1210
exclude: ["**/node_modules/**"]
1311
},

packages/solid-html/vite.config.mjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ import { defineConfig } from "vitest/config";
55
export default defineConfig({
66
test: {
77
environment: "jsdom",
8-
deps: { registerNodeLoader: true },
9-
threads: false,
10-
isolate: false,
8+
pool: "threads",
119
globals: true,
1210
exclude: ["**/node_modules/**"]
1311
},

packages/solid-signals/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"rollup-plugin-prettier": "^4.1.2",
6161
"tslib": "^2.8.1",
6262
"typescript": "5.9.3",
63-
"vite": "^5.4.10",
64-
"vitest": "^2.0.0"
63+
"vite": "^7.0.0",
64+
"vitest": "^3.2.4"
6565
}
6666
}

packages/solid-signals/tests/createErrorBoundary.test.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ import {
1212

1313
it("should let errors bubble up when not handled", () => {
1414
const error = new Error();
15-
expect(() => {
15+
let caught: any;
16+
try {
1617
createRoot(() => {
1718
createRenderEffect(
1819
() => {
@@ -22,7 +23,11 @@ it("should let errors bubble up when not handled", () => {
2223
);
2324
});
2425
flush();
25-
}).toThrowError(error);
26+
} catch (e) {
27+
caught = e;
28+
}
29+
expect(caught).toBeDefined();
30+
expect(caught.cause ?? caught).toBe(error);
2631
});
2732

2833
it("should handle error", () => {
@@ -130,13 +135,18 @@ it("should throw error if there are no handlers left", () => {
130135
});
131136

132137
createRoot(() => {
133-
expect(() => {
138+
let caught: any;
139+
try {
134140
createErrorBoundary(() => {
135141
createErrorBoundary(() => {
136142
throw error;
137143
}, handler)();
138144
}, handler)();
139-
}).toThrow(error);
145+
} catch (e) {
146+
caught = e;
147+
}
148+
expect(caught).toBeDefined();
149+
expect(caught.cause ?? caught).toBe(error);
140150
});
141151

142152
expect(handler).toHaveBeenCalledTimes(2);

packages/solid-web/vite.config.hydrate.mjs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ export default defineConfig({
1010
plugins: [solidPlugin({ solid: { dev: true, hydratable: true } })],
1111
test: {
1212
environment: "jsdom",
13-
transformMode: { web: [/\.[jt]sx?$/] },
14-
deps: { registerNodeLoader: true },
15-
threads: false,
16-
isolate: false,
13+
pool: "threads",
1714
globals: true,
1815
include: ["test/hydration/**/*.spec.tsx"]
1916
},

packages/solid-web/vite.config.mjs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,7 @@ export default defineConfig({
2020
exclude: ["**/*.d.ts", "src/server/*.ts"]
2121
},
2222
environment: "jsdom",
23-
transformMode: { web: [/\.[jt]sx?$/] },
24-
// otherwise, solid would be loaded twice:
25-
deps: { registerNodeLoader: true },
26-
// if you have few tests, try commenting one
27-
// or both out to improve performance:
28-
threads: false,
29-
isolate: false,
23+
pool: "threads",
3024
globals: true,
3125
exclude: ["**/node_modules/**", "wip_tests/**", "test/server/**", "test/hydration/**"],
3226
// Bench mode reads `benchmark.exclude` separately from `test.exclude`.

packages/solid-web/vite.config.server-bench.mjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ export default defineConfig({
2020
environment: "node",
2121
include: ["test/server/**/*.bench.tsx"],
2222
globals: true,
23-
threads: false,
24-
isolate: false,
23+
pool: "threads",
2524
benchmark: {
2625
include: ["test/server/**/*.bench.tsx"],
2726
exclude: ["**/node_modules/**", "test/*.bench.tsx"]

packages/solid-web/vite.config.server.mjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ export default defineConfig({
1212
environment: "node",
1313
include: ["test/server/**/*.spec.tsx"],
1414
globals: true,
15-
threads: false,
16-
isolate: false,
15+
pool: "threads",
1716
},
1817
resolve: {
1918
conditions: ["node"],

packages/solid/vite.config.mjs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,7 @@ export default defineConfig({
1717
exclude: ["**/*.d.ts", "src/server/*.ts"]
1818
},
1919
environment: "jsdom",
20-
// otherwise, solid would be loaded twice:
21-
deps: { registerNodeLoader: true },
22-
// if you have few tests, try commenting one
23-
// or both out to improve performance:
24-
threads: false,
25-
isolate: false,
20+
pool: "threads",
2621
globals: true,
2722
exclude: ["**/node_modules/**", "archived_tests/**"]
2823
},

0 commit comments

Comments
 (0)