chore: Update Vitest async test expectations and remove unused dependencies.

This commit is contained in:
2025-12-16 07:43:18 -05:00
parent 23b14536cc
commit 7793588e0b
7 changed files with 606 additions and 932 deletions

View File

@@ -18,7 +18,6 @@
}, },
"dependencies": { "dependencies": {
"@consumet/extensions": "github:consumet/consumet.ts#3dd0ccb", "@consumet/extensions": "github:consumet/consumet.ts#3dd0ccb",
"@haverstack/axios-fetch-adapter": "^0.12.0",
"@hono/swagger-ui": "^0.5.1", "@hono/swagger-ui": "^0.5.1",
"@hono/zod-openapi": "^0.19.5", "@hono/zod-openapi": "^0.19.5",
"@hono/zod-validator": "^0.2.2", "@hono/zod-validator": "^0.2.2",
@@ -35,7 +34,6 @@
}, },
"devDependencies": { "devDependencies": {
"@cloudflare/vitest-pool-workers": "^0.10.15", "@cloudflare/vitest-pool-workers": "^0.10.15",
"@cloudflare/workers-types": "^4.20250423.0",
"@trivago/prettier-plugin-sort-imports": "^4.3.0", "@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/lodash.isequal": "^4.5.8", "@types/lodash.isequal": "^4.5.8",
"@types/lodash.mapkeys": "^4.6.9", "@types/lodash.mapkeys": "^4.6.9",

1513
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -6,6 +6,6 @@ describe("Health Check", () => {
it("should return { success: true }", async () => { it("should return { success: true }", async () => {
const res = await app.request("/"); const res = await app.request("/");
expect(res.json()).resolves.toEqual({ success: true }); await expect(res.json()).resolves.toEqual({ success: true });
}); });
}); });

View File

@@ -44,7 +44,7 @@ describe("requests the /token route", () => {
body: JSON.stringify({ token: "123", deviceId: "123" }), body: JSON.stringify({ token: "123", deviceId: "123" }),
}); });
expect(res.json()).resolves.toEqual({ success: true }); await expect(res.json()).resolves.toEqual({ success: true });
expect(res.status).toBe(200); expect(res.status).toBe(200);
}); });
@@ -91,7 +91,7 @@ describe("requests the /token route", () => {
body: JSON.stringify({ token: "124", deviceId: "123" }), body: JSON.stringify({ token: "124", deviceId: "123" }),
}); });
expect(res.json()).resolves.toEqual({ success: true }); await expect(res.json()).resolves.toEqual({ success: true });
expect(res.status).toBe(200); expect(res.status).toBe(200);
}); });
@@ -161,7 +161,7 @@ describe("requests the /token route", () => {
body: JSON.stringify({ token: "123", deviceId: "124" }), body: JSON.stringify({ token: "123", deviceId: "124" }),
}); });
expect(res.json()).resolves.toEqual({ success: false }); await expect(res.json()).resolves.toEqual({ success: false });
expect(res.status).toBe(401); expect(res.status).toBe(401);
}); });

View File

@@ -165,7 +165,7 @@ describe("requests the /watch-status route", () => {
env, env,
); );
expect(res.json()).resolves.toEqual({ success: true }); await expect(res.json()).resolves.toEqual({ success: true });
expect(res.status).toBe(200); expect(res.status).toBe(200);
expect(removeTask).toHaveBeenCalled(); expect(removeTask).toHaveBeenCalled();
}); });
@@ -188,7 +188,7 @@ describe("requests the /watch-status route", () => {
env, env,
); );
expect(res.json()).resolves.toEqual({ success: true }); await expect(res.json()).resolves.toEqual({ success: true });
expect(res.status).toBe(200); expect(res.status).toBe(200);
}); });
@@ -214,7 +214,7 @@ describe("requests the /watch-status route", () => {
env, env,
); );
expect(res.json()).resolves.toEqual({ success: true }); await expect(res.json()).resolves.toEqual({ success: true });
expect(res.status).toBe(200); expect(res.status).toBe(200);
}); });

View File

@@ -3,8 +3,8 @@ import { describe, expect, it } from "vitest";
import { PromiseTimedOutError, promiseTimeout } from "./promiseTimeout"; import { PromiseTimedOutError, promiseTimeout } from "./promiseTimeout";
describe("promiseTimeout", () => { describe("promiseTimeout", () => {
it("promise resolves within timeout, returns value", () => { it("promise resolves within timeout, returns value", async () => {
expect( await expect(
promiseTimeout( promiseTimeout(
wait(1).then(() => 2), wait(1).then(() => 2),
10, 10,
@@ -12,8 +12,8 @@ describe("promiseTimeout", () => {
).resolves.toBe(2); ).resolves.toBe(2);
}); });
it("promise does not resolve within timeout, throws PromiseTimedOutError", () => { it("promise does not resolve within timeout, throws PromiseTimedOutError", async () => {
expect( await expect(
promiseTimeout( promiseTimeout(
wait(2).then(() => 2), wait(2).then(() => 2),
1, 1,

View File

@@ -17,7 +17,6 @@ export default defineWorkersProject(async () => {
}, },
poolOptions: { poolOptions: {
workers: { workers: {
// singleWorker: true,
wrangler: { wrangler: {
configPath: "./wrangler.toml", configPath: "./wrangler.toml",
}, },