Skip to content

Commit 8d648e7

Browse files
authored
feat(vitest-pool-workers): add support for vitest 3.2.x (#9439)
* feat(vitest-pool-workers): add support for vitest 3.2.x * chore(create-cloudflare): bump vitest version on hello-world templates * fix: remove unused onCancel method from our custom VitestTestRunner
1 parent 0e50072 commit 8d648e7

File tree

10 files changed

+215
-196
lines changed

10 files changed

+215
-196
lines changed

.changeset/forty-waves-stare.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@cloudflare/vitest-pool-workers": minor
3+
---
4+
5+
Add support for Vitest 3.2.x

.changeset/salty-ducks-repair.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"create-cloudflare": patch
3+
---
4+
5+
update vitest version on hello-world and hello-world-with-assets templates

packages/create-cloudflare/templates/hello-world-with-assets/js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
"devDependencies": {
1212
"@cloudflare/vitest-pool-workers": "^0.8.19",
1313
"wrangler": "^3.101.0",
14-
"vitest": "~3.0.7"
14+
"vitest": "~3.2.0"
1515
}
1616
}

packages/create-cloudflare/templates/hello-world-with-assets/ts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"devDependencies": {
1313
"@cloudflare/vitest-pool-workers": "^0.8.19",
1414
"typescript": "^5.5.2",
15-
"vitest": "~3.0.7",
15+
"vitest": "~3.2.0",
1616
"wrangler": "^3.101.0"
1717
}
1818
}

packages/create-cloudflare/templates/hello-world/js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
"devDependencies": {
1212
"@cloudflare/vitest-pool-workers": "^0.8.19",
1313
"wrangler": "^3.101.0",
14-
"vitest": "~3.0.7"
14+
"vitest": "~3.2.0"
1515
}
1616
}

packages/create-cloudflare/templates/hello-world/ts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"devDependencies": {
1313
"@cloudflare/vitest-pool-workers": "^0.8.19",
1414
"typescript": "^5.5.2",
15-
"vitest": "~3.0.7",
15+
"vitest": "~3.2.0",
1616
"wrangler": "^3.101.0"
1717
}
1818
}

packages/vitest-pool-workers/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@
7676
"vitest": "catalog:default"
7777
},
7878
"peerDependencies": {
79-
"@vitest/runner": "2.0.x - 3.1.x",
80-
"@vitest/snapshot": "2.0.x - 3.1.x",
81-
"vitest": "2.0.x - 3.1.x"
79+
"@vitest/runner": "2.0.x - 3.2.x",
80+
"@vitest/snapshot": "2.0.x - 3.2.x",
81+
"vitest": "2.0.x - 3.2.x"
8282
},
8383
"volta": {
8484
"extends": "../../package.json"

packages/vitest-pool-workers/src/worker/lib/cloudflare/test-runner.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
import { vi } from "vitest";
1212
import { VitestTestRunner } from "vitest/runners";
1313
import workerdUnsafe from "workerd:unsafe";
14-
import type { CancelReason, Suite, Test } from "@vitest/runner";
14+
import type { Suite, Test } from "@vitest/runner";
1515
import type { SerializedConfig, WorkerGlobalState, WorkerRPC } from "vitest";
1616

1717
// When `DEBUG` is `true`, runner operations will be logged and slowed down
@@ -355,12 +355,4 @@ export default class WorkersTestRunner extends VitestTestRunner {
355355

356356
return super.onAfterTryTask(test);
357357
}
358-
359-
async onCancel(reason: CancelReason) {
360-
if (DEBUG) {
361-
__console.log(`onCancel: ${reason}`);
362-
await scheduler.wait(100);
363-
}
364-
return super.onCancel(reason);
365-
}
366358
}

pnpm-lock.yaml

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

pnpm-workspace.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ packages:
1717

1818
catalog:
1919
"@types/node": "^20.17.32"
20-
"@vitest/runner": ~3.1.1
21-
"@vitest/snapshot": ~3.1.1
22-
"@vitest/ui": ~3.1.1
20+
"@vitest/runner": ~3.2.0
21+
"@vitest/snapshot": ~3.2.0
22+
"@vitest/ui": ~3.2.0
2323
# rimraf@6 requires node 20 or >=22
2424
rimraf: "^6.0.1"
2525
typescript: "^5.7.2"
2626
undici: "^5.28.5"
27-
vitest: "~3.1.1"
27+
vitest: "~3.2.0"
2828
vite: "^5.4.14"
2929
"ws": "8.18.0"
3030
esbuild: "0.25.4"

0 commit comments

Comments
 (0)