Skip to content

Commit 6fa2c80

Browse files
jaggederestclaude
andcommitted
chore: update vitest to v3.2.4 and fix test assertions
- Updated vitest from v0.34.6 to v3.2.4 - Fixed failing tests by replacing .toMatch() with .toThrowError() for rejected promise assertions - All tests now pass with the updated vitest version 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 73b4458 commit 6fa2c80

File tree

4 files changed

+512
-549
lines changed

4 files changed

+512
-549
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@
321321
"tsc-watch": "^6.2.1",
322322
"typescript": "^5.4.5",
323323
"utf-8-validate": "^6.0.5",
324-
"vitest": "^0.34.6",
324+
"vitest": "^3.2.4",
325325
"vscode-test": "^1.5.0",
326326
"webpack": "^5.99.6",
327327
"webpack-cli": "^5.1.4"

src/error.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ it("falls back with different error", async () => {
246246
servername: "localhost",
247247
}),
248248
});
249-
await expect(request).rejects.toMatch(/failed with status code 500/);
249+
await expect(request).rejects.toThrowError(/failed with status code 500/);
250250
try {
251251
await request;
252252
} catch (error) {

src/headers.test.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,25 +71,25 @@ it("should return headers", async () => {
7171
it("should error on malformed or empty lines", async () => {
7272
await expect(
7373
getHeaders("localhost", "printf 'foo=bar\\r\\n\\r\\n'"),
74-
).rejects.toMatch(/Malformed/);
74+
).rejects.toThrowError(/Malformed/);
7575
await expect(
7676
getHeaders("localhost", "printf '\\r\\nfoo=bar'"),
77-
).rejects.toMatch(/Malformed/);
78-
await expect(getHeaders("localhost", "printf '=foo'")).rejects.toMatch(
77+
).rejects.toThrowError(/Malformed/);
78+
await expect(getHeaders("localhost", "printf '=foo'")).rejects.toThrowError(
7979
/Malformed/,
8080
);
81-
await expect(getHeaders("localhost", "printf 'foo'")).rejects.toMatch(
81+
await expect(getHeaders("localhost", "printf 'foo'")).rejects.toThrowError(
8282
/Malformed/,
8383
);
84-
await expect(getHeaders("localhost", "printf ' =foo'")).rejects.toMatch(
85-
/Malformed/,
86-
);
87-
await expect(getHeaders("localhost", "printf 'foo =bar'")).rejects.toMatch(
84+
await expect(getHeaders("localhost", "printf ' =foo'")).rejects.toThrowError(
8885
/Malformed/,
8986
);
87+
await expect(
88+
getHeaders("localhost", "printf 'foo =bar'"),
89+
).rejects.toThrowError(/Malformed/);
9090
await expect(
9191
getHeaders("localhost", "printf 'foo foo=bar'"),
92-
).rejects.toMatch(/Malformed/);
92+
).rejects.toThrowError(/Malformed/);
9393
});
9494

9595
it("should have access to environment variables", async () => {
@@ -105,7 +105,7 @@ it("should have access to environment variables", async () => {
105105
});
106106

107107
it("should error on non-zero exit", async () => {
108-
await expect(getHeaders("localhost", "exit 10")).rejects.toMatch(
108+
await expect(getHeaders("localhost", "exit 10")).rejects.toThrowError(
109109
/exited unexpectedly with code 10/,
110110
);
111111
});

0 commit comments

Comments
 (0)