Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/forty-waves-stare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cloudflare/vitest-pool-workers": minor
---

Add support for Vitest 3.2.x
5 changes: 5 additions & 0 deletions .changeset/salty-ducks-repair.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-cloudflare": patch
---

update vitest version on hello-world and hello-world-with-assets templates
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"devDependencies": {
"@cloudflare/vitest-pool-workers": "^0.8.19",
"wrangler": "^3.101.0",
"vitest": "~3.0.7"
"vitest": "~3.2.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"devDependencies": {
"@cloudflare/vitest-pool-workers": "^0.8.19",
"typescript": "^5.5.2",
"vitest": "~3.0.7",
"vitest": "~3.2.0",
"wrangler": "^3.101.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"devDependencies": {
"@cloudflare/vitest-pool-workers": "^0.8.19",
"wrangler": "^3.101.0",
"vitest": "~3.0.7"
"vitest": "~3.2.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"devDependencies": {
"@cloudflare/vitest-pool-workers": "^0.8.19",
"typescript": "^5.5.2",
"vitest": "~3.0.7",
"vitest": "~3.2.0",
"wrangler": "^3.101.0"
}
}
6 changes: 3 additions & 3 deletions packages/vitest-pool-workers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@
"vitest": "catalog:default"
},
"peerDependencies": {
"@vitest/runner": "2.0.x - 3.1.x",
"@vitest/snapshot": "2.0.x - 3.1.x",
"vitest": "2.0.x - 3.1.x"
"@vitest/runner": "2.0.x - 3.2.x",
"@vitest/snapshot": "2.0.x - 3.2.x",
"vitest": "2.0.x - 3.2.x"
},
"volta": {
"extends": "../../package.json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
import { vi } from "vitest";
import { VitestTestRunner } from "vitest/runners";
import workerdUnsafe from "workerd:unsafe";
import type { CancelReason, Suite, Test } from "@vitest/runner";
import type { Suite, Test } from "@vitest/runner";
import type { SerializedConfig, WorkerGlobalState, WorkerRPC } from "vitest";

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

return super.onAfterTryTask(test);
}

async onCancel(reason: CancelReason) {
if (DEBUG) {
__console.log(`onCancel: ${reason}`);
await scheduler.wait(100);
}
return super.onCancel(reason);
}
Comment on lines -359 to -365
Copy link
Member Author

@edmundhung edmundhung Jun 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The onCancel method is renamed to cancel on Vitest 3.2 (https://github.com/vitest-dev/vitest/pull/7878/files#r2058686709)

We can rename it and check whether the method exists, but it seems to be redundant for users as we were adding it just for debug purpose and will require us modify the debug flag manually instead of a user facing config.

}
369 changes: 193 additions & 176 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ packages:

catalog:
"@types/node": "^20.17.32"
"@vitest/runner": ~3.1.1
"@vitest/snapshot": ~3.1.1
"@vitest/ui": ~3.1.1
"@vitest/runner": ~3.2.0
"@vitest/snapshot": ~3.2.0
"@vitest/ui": ~3.2.0
# rimraf@6 requires node 20 or >=22
rimraf: "^6.0.1"
typescript: "^5.7.2"
undici: "^5.28.5"
vitest: "~3.1.1"
vitest: "~3.2.0"
vite: "^5.4.14"
"ws": "8.18.0"
esbuild: "0.25.4"
Expand Down
Loading