-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathvitest.config.ts
More file actions
43 lines (42 loc) · 2.03 KB
/
vitest.config.ts
File metadata and controls
43 lines (42 loc) · 2.03 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
import { defineConfig } from "vitest/config";
import { resolve } from "node:path";
export default defineConfig({
test: {
// Sandbox initialization can take a few seconds on first run
testTimeout: 30_000,
// Only run tests from this project, not from deps/
include: ["tests/**/*.test.ts"],
// Exclude compiled build artefacts and dependency clones
exclude: ["dist/**", "node_modules/**", "deps/**"],
// On Windows, two SurrogateProcessManagers each pre-create a pool of
// surrogate processes. Keep the initial pool small — on-demand growth
// up to the default 512 max handles spikes without wasting resources.
env:
process.platform === "win32"
? {
HYPERLIGHT_INITIAL_SURROGATES: "4",
}
: {},
},
resolve: {
alias: {
// Map ha:* module imports to builtin-modules/ for standalone testing.
// In the sandbox these are resolved by the hyperlight-js UserModuleLoader.
"ha:doc-core": resolve(__dirname, "builtin-modules/doc-core.js"),
"ha:ooxml-core": resolve(__dirname, "builtin-modules/ooxml-core.js"),
"ha:pdf": resolve(__dirname, "builtin-modules/pdf.js"),
"ha:pdf-charts": resolve(__dirname, "builtin-modules/pdf-charts.js"),
"ha:xml-escape": resolve(__dirname, "builtin-modules/xml-escape.js"),
"ha:str-bytes": resolve(__dirname, "builtin-modules/str-bytes.js"),
"ha:crc32": resolve(__dirname, "builtin-modules/crc32.js"),
"ha:base64": resolve(__dirname, "builtin-modules/base64.js"),
// ha:ziplib is a native Rust module — use Node.js zlib shim for vitest
"ha:ziplib": resolve(__dirname, "tests/shims/ziplib.shim.js"),
"ha:shared-state": resolve(__dirname, "builtin-modules/shared-state.js"),
"ha:zip-format": resolve(__dirname, "builtin-modules/zip-format.js"),
"ha:pptx": resolve(__dirname, "builtin-modules/pptx.js"),
"ha:pptx-charts": resolve(__dirname, "builtin-modules/pptx-charts.js"),
"ha:pptx-tables": resolve(__dirname, "builtin-modules/pptx-tables.js"),
},
},
});