-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.js
More file actions
44 lines (43 loc) · 2 KB
/
Copy pathvitest.config.js
File metadata and controls
44 lines (43 loc) · 2 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
// ADC-IMPLEMENTS: <shell-test-federation-01>
// ADC-IMPLEMENTS: <shell-test-federation-cross-section-05>
// ADC-IMPLEMENTS: <shell-test-modularity-02>
// ADC-IMPLEMENTS: <section-test-manifest-01>
// ADC-IMPLEMENTS: <section-test-routing-02>
// ADC-IMPLEMENTS: <section-test-feed-03>
// ADC-IMPLEMENTS: <portfolio-test-add-entry-01>
// ADC-IMPLEMENTS: <portfolio-test-r2-resolution-02>
// ADC-IMPLEMENTS: <stubs-test-stubs-render-01>
// ADC-IMPLEMENTS: <home-test-params-no-precedent-03>
//
// Vitest configuration. Vitest covers every TestScenario that does NOT need a
// real browser — static analysis of built HTML/CSS (federation, stub render),
// pure-JS unit tests (R2 helper, feed loader), and build-orchestrated tests
// that mutate the source tree, run `astro build`, and inspect `dist/`
// (modularity, federation, portfolio-add-entry).
//
// Browser-required scenarios (mobile viewport scrollWidth, engine slot canvas
// pixel changes, the engine swap test, /dnd-tabletop/ HTTP fetch) live in
// `tests/**/*.e2e.js` and run under Playwright; see `playwright.config.js`.
//
// Naming convention enforces the split:
// *.spec.js → Vitest (this file's `include` pattern)
// *.e2e.js → Playwright (playwright.config.js's `testMatch`)
// Both runners are dispatched by `npm test`.
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
include: ["tests/**/*.spec.js"],
// Some Vitest tests run `astro build` against the real source tree and
// can take 30+ seconds; give the suite headroom. Per-test timeouts inside
// the suites tighten this when appropriate.
testTimeout: 120_000,
hookTimeout: 120_000,
// Tests that mutate `src/` (modularity, federation synthetic sections,
// portfolio-add-entry) MUST run serially — they hold a lock on the
// working tree. We disable file parallelism globally; suites are
// independent across files but share the source tree.
fileParallelism: false,
pool: "forks",
forks: { singleFork: true },
},
});