-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvitest.config.ts
More file actions
46 lines (44 loc) · 1.16 KB
/
vitest.config.ts
File metadata and controls
46 lines (44 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import { cloudflareTest } from "@cloudflare/vitest-pool-workers";
import { resolve } from "node:path";
import { defineConfig } from "vitest/config";
const TEST_ENCRYPTION_KEY = Buffer.alloc(32, 7).toString("base64");
const VITEST_POOL_COMPATIBILITY_FLAGS = [
"enable_nodejs_tty_module",
"enable_nodejs_fs_module",
"enable_nodejs_http_modules",
"enable_nodejs_perf_hooks_module",
"enable_nodejs_v8_module",
"enable_nodejs_process_v2",
];
export default defineConfig({
plugins: [
cloudflareTest({
main: "./src/worker/index.ts",
wrangler: {
configPath: "./wrangler.jsonc",
},
miniflare: {
assets: {
directory: "./tests/assets",
},
compatibilityFlags: VITEST_POOL_COMPATIBILITY_FLAGS,
bindings: {
APP_ENCRYPTION_KEY_CURRENT_VERSION: "1",
APP_ENCRYPTION_KEYS_JSON: JSON.stringify({
1: TEST_ENCRYPTION_KEY,
}),
},
},
}),
],
resolve: {
alias: {
"@": resolve(__dirname, "src"),
},
},
test: {
fileParallelism: false,
include: ["tests/**/*.test.ts"],
exclude: ["tests/integration/**/*.test.ts"],
},
});