-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvitest.config.ts
More file actions
49 lines (48 loc) · 1.62 KB
/
Copy pathvitest.config.ts
File metadata and controls
49 lines (48 loc) · 1.62 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
47
48
49
import { defineConfig } from "vitest/config";
import { cloudflareTest } from "@cloudflare/vitest-pool-workers";
export default defineConfig({
plugins: [
cloudflareTest({
main: "./src/index.ts",
miniflare: {
compatibilityDate: "2025-02-14",
compatibilityFlags: ["nodejs_compat"],
kvNamespaces: ["RESOLVER_CACHE"],
r2Buckets: ["IPFS_CACHE"],
// Mirror wrangler.toml [[rules]] so the pool externalises these
// imports to workerd instead of letting Vite try to bundle them.
modulesRules: [
{ type: "CompiledWasm", include: ["**/*.wasm"], fallthrough: true },
{ type: "Data", include: ["**/*.ttf", "**/*.otf"], fallthrough: true },
{ type: "Text", include: ["**/*.svg"], fallthrough: true },
],
bindings: {
ETH_RPC_URL: "https://cloudflare-eth.com",
SEPOLIA_RPC_URL: "https://sepolia.drpc.org",
HOLESKY_RPC_URL: "https://holesky.drpc.org",
IPFS_GATEWAYS:
"https://w3s.link,https://nftstorage.link,https://ipfs.io",
SUBGRAPH_URL_MAINNET: "https://example.invalid/mainnet",
SUBGRAPH_URL_SEPOLIA: "https://example.invalid/sepolia",
SUBGRAPH_URL_HOLESKY: "https://example.invalid/holesky",
},
},
}),
],
test: {
include: ["test/**/*.test.ts"],
exclude: [
".context/**",
"coverage/**",
"dist/**",
"build/**",
"node_modules/**",
],
coverage: {
provider: "istanbul",
reporter: ["text", "json", "html"],
include: ["src/**/*.ts"],
exclude: ["src/**/*.d.ts"],
},
},
});