forked from ag-grid/ag-grid
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
30 lines (27 loc) · 1.52 KB
/
Copy pathvitest.config.ts
File metadata and controls
30 lines (27 loc) · 1.52 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
import { defineConfig } from 'vitest/config';
import { resultJsonFile, vitestReporters } from './testing/shared/vitest/shared';
import projects from './vitest.workspace';
// Vitest adds one `unhandledRejection` listener to `process` per project pool; a full run has
// enough projects to trip Node's default 10-listener cap and print a spurious MaxListenersExceededWarning.
// Lift the cap on `process` only — leak detection on every other emitter (incl. grid code) is untouched.
process.setMaxListeners(0);
// Root config for the merged multi-project run. Vitest reads runner-global options — reporters/outputFile,
// coverage, watch — from HERE, not from the per-project configs, so anything global must live in this file
// to take effect during `./behave.sh`. Project-scoped options (pool, environment, setupFiles) do NOT
// cascade from here, so each project config sets its own; `unitProjectTestConfig` keeps them consistent.
export default defineConfig({
// Don't wipe the terminal scrollback when the run starts.
clearScreen: false,
test: {
projects,
watch: false,
// Runner-global, and the only place it counts: vitest builds each worker's `sequence` wholly from
// the root config, so the projects' own copy applies to a standalone `nx test <project>` run alone.
sequence: { setupFiles: 'list' },
reporters: vitestReporters(),
outputFile: {
junit: 'reports/workspace.xml',
...(resultJsonFile ? { json: resultJsonFile } : {}),
},
},
});