-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
47 lines (46 loc) · 1.32 KB
/
Copy pathvitest.config.ts
File metadata and controls
47 lines (46 loc) · 1.32 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
import { defineConfig } from "vitest/config";
import path from "path";
export default defineConfig({
test: {
// Browser mode configuration for benchmarks
browser: {
enabled: true,
provider: "playwright",
instances: [{ browser: "chromium" }],
headless: true,
},
// Benchmark configuration
benchmark: {
include: ["benchmarks/browser/**/*.bench.ts"],
reporters: ["default"],
// JSON output configured via CLI: --reporter=json --outputFile=benchmark-results.json
},
// Include pattern for benchmark files
include: ["benchmarks/browser/**/*.bench.ts"],
},
// Serve WASM files correctly
assetsInclude: ["**/*.wasm"],
publicDir: false,
// Pre-bundle CommonJS dependencies for stable browser testing
optimizeDeps: {
include: ["fftw-js"],
},
server: {
fs: {
// Allow serving files from project root
allow: ["."],
},
// Cross-origin isolation gives performance.now() 5µs resolution in Chromium
// (otherwise it is clamped to 100µs, quantizing every benchmark sample)
headers: {
"Cross-Origin-Opener-Policy": "same-origin",
"Cross-Origin-Embedder-Policy": "require-corp",
},
},
resolve: {
alias: {
// Allow importing from dist directory
"@dist": path.resolve(__dirname, "dist"),
},
},
});