-
Notifications
You must be signed in to change notification settings - Fork 665
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade @cloudflare/vitest-pool-workers
to Vitest v2+
#6232
Changes from all commits
863349c
d6c8540
ea50ff0
8ee2289
7268a69
f8e48c9
5cbea8d
6ae54a9
acc0f99
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@cloudflare/vitest-pool-workers": minor | ||
--- | ||
|
||
feat: Support Vitest v2.0.x | ||
|
||
This drops support for Vitest@1, due to the issues described in [workers-sdk#6071](https://github.com/cloudflare/workers-sdk/issues/6071) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,7 +50,7 @@ | |
"turbo": "^1.10.14", | ||
"typescript": "^5.5.2", | ||
"vite": "^5.0.12", | ||
"vitest": "^1.2.2" | ||
"vitest": "catalog:default" | ||
}, | ||
"packageManager": "[email protected]", | ||
"engines": { | ||
|
@@ -75,7 +75,7 @@ | |
"@types/react-transition-group>@types/react": "^18", | ||
"@cloudflare/elements>@types/react": "^18", | ||
"capnpc-ts>typescript": "4.2.4", | ||
"vitest@1.5.0>@types/node": "$@types/node" | ||
"vitest>@types/node": "$@types/node" | ||
}, | ||
"patchedDependencies": { | ||
"[email protected]": "patches/[email protected]", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,19 +67,19 @@ | |
"@cloudflare/workers-types": "^4.20240909.0", | ||
"@types/node": "20.8.3", | ||
"@types/semver": "^7.5.1", | ||
"@vitest/runner": "1.3.x - 1.5.x", | ||
"@vitest/snapshot": "1.3.x - 1.5.x", | ||
"@vitest/runner": "catalog:default", | ||
"@vitest/snapshot": "catalog:default", | ||
"capnp-ts": "^0.7.0", | ||
"capnpc-ts": "^0.7.0", | ||
"ts-dedent": "^2.2.0", | ||
"typescript": "^5.5.2", | ||
"undici": "^5.28.4", | ||
"vitest": "1.5.0" | ||
"vitest": "catalog:default" | ||
}, | ||
"peerDependencies": { | ||
"@vitest/runner": "1.3.x - 1.5.x", | ||
"@vitest/snapshot": "1.3.x - 1.5.x", | ||
"vitest": "1.3.x - 1.5.x" | ||
"@vitest/runner": "2.0.x", | ||
"@vitest/snapshot": "2.0.x", | ||
"vitest": "2.0.x" | ||
Comment on lines
+80
to
+82
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These don't use the catalog because I'm hopeful we can make it a range in future |
||
}, | ||
"volta": { | ||
"extends": "../../package.json" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,8 +19,7 @@ test.skipIf(process.platform === "win32")( | |
}); | ||
const result = vitestDev(); | ||
await waitFor(() => { | ||
expect(result.stdout).toMatch("stdout | index.test.ts:2:9\nglobal"); | ||
expect(result.stdout).toMatch("stdout | index.test.ts:4:10\ndescribe"); | ||
expect(result.stdout).toMatch("stdout | index.test.ts\nglobal\ndescribe"); | ||
expect(result.stdout).toMatch( | ||
"stdout | index.test.ts > thing > does something\ntest" | ||
); | ||
|
@@ -42,10 +41,10 @@ test.skipIf(process.platform === "win32")( | |
`, | ||
}); | ||
await waitFor(() => { | ||
expect(result.stdout).toMatch("stdout | index.test.ts:2:9\nnew global"); | ||
expect(result.stdout).toMatch( | ||
"stdout | index.test.ts:4:10\nnew describe" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems to be a change in the Vitest output to remove line numbers (verified by upgrading Wrangler to Vitest v2+ and seeing the change) |
||
"stdout | index.test.ts\nnew global\nnew describe" | ||
); | ||
|
||
expect(result.stdout).toMatch( | ||
"stdout | index.test.ts > new thing > does something else\nnew test" | ||
); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reference this is needed because the
name
variable here does not result in thespyOn()
function being narrowed enough for it to generate a sensible return type, resultng innever
.