-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Expand file tree
/
Copy pathvitest.config.ts
More file actions
41 lines (40 loc) · 1.93 KB
/
Copy pathvitest.config.ts
File metadata and controls
41 lines (40 loc) · 1.93 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
import { resolve } from "node:path";
import { defineConfig } from "vitest/config";
export default defineConfig({
resolve: {
alias: [
// Resolve the bare @hyperframes/core entry to TypeScript source, not built
// dist. The published dist intentionally omits runtime/entry.ts, so the
// dist build of loadHyperframeRuntimeSource() returns null — which makes
// studioServer.test.ts's runtime-source equality assertion diverge. Tests
// run under bun against source; subpath imports (@hyperframes/core/*) keep
// resolving via the package's export conditions.
{
find: /^@hyperframes\/core$/,
replacement: resolve(__dirname, "../core/src/index.ts"),
},
// Same reason the tsup build aliases this specifier to source: the CLI
// bundles the producer rather than depending on it at runtime, so its
// dist is not built for the test job. Without the alias, vite's import
// analysis resolves studioServer.ts's `import("@hyperframes/producer")`
// against an unbuilt package and the whole suite fails to collect.
{
find: /^@hyperframes\/producer$/,
replacement: resolve(__dirname, "../producer/src/index.ts"),
},
],
},
test: {
include: ["src/**/*.test.ts"],
// Many CLI tests cold-import a heavy command module graph via dynamic
// `import()` (e.g. render.js, auth/status.js, telemetry/system.js). Under
// the full parallel monorepo run (`bun run --filter '!@hyperframes/producer'
// test`) that cold load contends for CPU and routinely blows vitest's 5s
// default test timeout / 10s hook timeout on CI runners — a recurring
// flake that has failed unrelated PRs (see PRs #1843, #1850). These
// generous ceilings absorb the contention while still catching a genuine
// hang. Prefer this one config knob over per-test/per-hook timeout bandaids.
testTimeout: 20_000,
hookTimeout: 30_000,
},
});