Repository navigation
Expand file tree
/
Copy pathvitest.config.ts
More file actions
44 lines (43 loc) · 1.49 KB
/
Copy pathvitest.config.ts
File metadata and controls
44 lines (43 loc) · 1.49 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
import { defineConfig } from "vitest/config";
import { join } from "node:path";
import { availableParallelism } from "node:os";
export default defineConfig({
test: {
environment: "node",
projects: [
{
test: {
name: "unit",
environment: "node",
// Leave one CPU for the coordinator/OS.
maxWorkers: Math.min(10, Math.max(1, availableParallelism() - 1)),
include: ["src/**/*.test.ts", "test/lint/rules/**/*.test.ts"],
testTimeout: 20_000,
hookTimeout: 20_000,
},
},
{
// Keep the test timeout above the 25s subprocess guard for diagnostics.
test: {
name: "golden",
// Each worker spawns a CLI process with SDK loading and real scrypt.
maxWorkers: Math.min(4, availableParallelism()),
// Vitest requires separate groups for different worker caps.
sequence: { groupOrder: 1 },
environment: "node",
include: ["test/**/*.test.ts"],
exclude: ["test/lint/rules/**"],
// Allow repeated CLI startup and real scrypt on busy CI runners.
testTimeout: 60_000,
hookTimeout: 30_000,
// Preserve the installed-package entry supplied by verify:package.
globalSetup: ["./test/build-entry.ts"],
env: {
WALLET_CLI_TEST_ENTRY:
process.env.WALLET_CLI_TEST_ENTRY ?? join(process.cwd(), "dist", "index.js"),
},
},
},
],
},
});