Skip to content

Commit 12321b5

Browse files
committed
Setup vitest worker pool
1 parent 7b2f086 commit 12321b5

File tree

8 files changed

+4812
-5588
lines changed

8 files changed

+4812
-5588
lines changed

apps/sandbox-container/package.json

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,26 @@
1616
},
1717
"dependencies": {
1818
"@cloudflare/workers-oauth-provider": "0.0.2",
19-
"@cloudflare/workers-types": "^4.20250320.0",
20-
"@hono/node-server": "^1.13.8",
21-
"@hono/zod-validator": "^0.4.3",
22-
"@modelcontextprotocol/sdk": "^1.7.0",
23-
"@types/node": "^22.13.10",
24-
"agents": "^0.0.42",
25-
"cron-schedule": "^5.0.4",
26-
"esbuild": "^0.25.1",
27-
"hono": "^4.7.5",
28-
"mime": "^4.0.6",
29-
"octokit": "^4.1.2",
30-
"partyserver": "^0.0.65",
31-
"tsx": "^4.19.3",
19+
"@hono/node-server": "1.13.8",
20+
"@hono/zod-validator": "0.4.3",
21+
"@modelcontextprotocol/sdk": "1.8.0",
22+
"@repo/mcp-common": "workspace:*",
23+
"@types/node": "22.14.1",
24+
"agents": "0.0.49",
25+
"cron-schedule": "5.0.4",
26+
"esbuild": "0.25.1",
27+
"hono": "4.7.6",
28+
"mime": "4.0.6",
29+
"octokit": "4.1.2",
30+
"partyserver": "0.0.65",
31+
"tsx": "4.19.3",
3232
"workers-mcp": "0.1.0-3",
33-
"zod": "^3.24.2",
34-
"@repo/mcp-common": "workspace:*"
33+
"zod": "3.24.2"
3534
},
3635
"devDependencies": {
37-
"concurrently": "^9.1.2",
38-
"wrangler": "^4.9.1"
36+
"@cloudflare/vitest-pool-workers": "0.8.14",
37+
"concurrently": "9.1.2",
38+
"vitest": "3.0.9",
39+
"wrangler": "4.10.0"
3940
}
4041
}
Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
11
{
2-
"compilerOptions": {
3-
"target": "ESNext",
4-
"lib": ["ESNext", "DOM"],
5-
"jsx": "react-jsx",
6-
"module": "ESNext",
7-
"moduleResolution": "bundler",
8-
"types": ["./worker-configuration.d.ts", "@cloudflare/workers-types/2023-07-01"],
9-
"noEmit": true,
10-
"esModuleInterop": true,
11-
"forceConsistentCasingInFileNames": true,
12-
"strict": true,
13-
"skipLibCheck": true
14-
},
15-
"include": ["server/**.ts", "shared/**.ts"]
16-
}
2+
"extends": "@repo/typescript-config/workers.json"
3+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ESNext",
4+
"lib": ["ESNext", "DOM"],
5+
"jsx": "react-jsx",
6+
"module": "ESNext",
7+
"moduleResolution": "bundler",
8+
"types": ["./worker-configuration.d.ts", "node"],
9+
"noEmit": true,
10+
"esModuleInterop": true,
11+
"forceConsistentCasingInFileNames": true,
12+
"strict": true,
13+
"skipLibCheck": true
14+
},
15+
"include": ["server/**.ts", "shared/**.ts"]
16+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { defineWorkersConfig } from "@cloudflare/vitest-pool-workers/config";
2+
3+
export interface TestEnv extends Env {
4+
CLOUDFLARE_MOCK_ACCOUNT_ID: string
5+
CLOUDFLARE_MOCK_API_TOKEN: string
6+
}
7+
8+
export default defineWorkersConfig({
9+
test: {
10+
poolOptions: {
11+
workers: {
12+
wrangler: { configPath: "./wrangler.jsonc" },
13+
miniflare: {
14+
bindings: {
15+
CLOUDFLARE_MOCK_ACCOUNT_ID: 'mock-account-id',
16+
CLOUDFLARE_MOCK_API_TOKEN: 'mock-api-token',
17+
} satisfies Partial<TestEnv>,
18+
},
19+
},
20+
},
21+
},
22+
});

0 commit comments

Comments
 (0)