Skip to content

Commit

Permalink
fix: upgraded vitest to latest (#1746)
Browse files Browse the repository at this point in the history
  • Loading branch information
davenewza authored Feb 28, 2025
1 parent d8cab8e commit caf15f5
Show file tree
Hide file tree
Showing 7 changed files with 3,849 additions and 3,760 deletions.
29 changes: 12 additions & 17 deletions integration/testdata/functions_errors/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,28 @@ import { test, beforeEach, expect } from "vitest";

beforeEach(resetDatabase);

class CustomError extends Error {
code: string;
constructor(code: string, message: string) {
super(message);
this.code = code;
}
}

test("Not found errors", async () => {
await expect(
(async () => {
await actions.hookNotFound({
id: "123",
});
})()
).rejects.toThrowError(
new CustomError("ERR_RECORD_NOT_FOUND", "record not found")
);
).rejects.toEqual({
code: "ERR_RECORD_NOT_FOUND",
message: "record not found",
});

await expect(
(async () => {
await actions.hookNotFoundCustomMessage({
id: "123",
});
})()
).rejects.toThrowError(
new CustomError("ERR_RECORD_NOT_FOUND", "nothing here")
);
).rejects.toEqual({
code: "ERR_RECORD_NOT_FOUND",
message: "nothing here",
});
});

test("Bad request errors", async () => {
Expand All @@ -40,7 +34,8 @@ test("Bad request errors", async () => {
id: "123",
});
})()
).rejects.toThrowError(
new CustomError("ERR_INVALID_INPUT", "invalid inputs")
);
).rejects.toEqual({
code: "ERR_INVALID_INPUT",
message: "invalid inputs",
});
});
2 changes: 1 addition & 1 deletion node/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func GetDependencies(options *bootstrapOptions) (map[string]string, map[string]s
"@types/node": "18.11.18",
"tsx": "4.11.0",
"typescript": "5.3.3",
"vitest": "0.34.6",
"vitest": "^3.0.7",
}

return deps, devDeps
Expand Down
4 changes: 2 additions & 2 deletions packages/functions-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Internal package used by @teamkeel/sdk",
"main": "src/index.js",
"scripts": {
"test": "vitest run --reporter verbose --threads false",
"test": "vitest run --reporter verbose --pool=threads --poolOptions.threads.singleThread",
"format": "npx prettier --write src/**/*.js"
},
"keywords": [],
Expand All @@ -16,7 +16,7 @@
},
"devDependencies": {
"prettier": "3.1.1",
"vitest": "^0.34.6"
"vitest": "^3.0.7"
},
"dependencies": {
"@aws-sdk/client-s3": "~3.722.0",
Expand Down
Loading

0 comments on commit caf15f5

Please sign in to comment.