Repository navigation
Expand file tree
/
Copy pathjest.config.js
More file actions
49 lines (49 loc) · 3.02 KB
/
Copy pathjest.config.js
File metadata and controls
49 lines (49 loc) · 3.02 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
45
46
47
48
49
module.exports = {
// Reap jest workers orphaned by a CANCELLED run before starting a new one.
// `--forceExit` only covers a clean exit; when the jest PARENT is killed (a CI
// timeout, Ctrl-C, an agent harness cancelling a long command), the worker pool
// survives on Windows and keeps spinning.
// Measured 2026-08-03: 101 orphans holding 4,020 CPU-seconds turned a ~90 s suite
// into a >10 min one, and made every timing measurement on this machine — including
// several parallel-lane baselines — quietly untrustworthy.
// Fails open: any error logs and continues. See the script header.
globalSetup: '<rootDir>/scripts/ci/reap-orphan-jest.js',
// No unit test reaches a real chain to check a wallet signature (see the file's header).
// No unit test calls the live prover either (BUS F-7; see the file's header).
// No unit test reaches a database to record a used owner approval (P0-TK-03; see the file's header).
// No unit test reaches a database to read a circuit breaker (see the file's header).
setupFiles: ['<rootDir>/tests/helpers/offline-signature-chain.ts', '<rootDir>/tests/helpers/offline-prover.ts', '<rootDir>/tests/helpers/offline-owner-auth-nonces.ts', '<rootDir>/tests/helpers/offline-circuit-breakers.ts'],
preset: 'ts-jest',
testEnvironment: 'node',
// DISCOVERY, NOT A LIST [2026-09-03]. This was
// `['<rootDir>/tests', '<rootDir>/src/hal/lib/__tests__']` — one directory under src,
// named by hand — and SIX other `src/**/__tests__` directories holding 52 assertions
// were therefore never executed by any run, local or CI, for months.
//
// What that cost is the argument for the change. Those 52 assertions were not merely
// idle: 18 of them FAILED when finally run, and two of the files had gone actively
// wrong in ways a running test would have stopped —
// * two asserted the TUNED RepID constants as expected values, which
// config/scoring-params.ts exists specifically to keep out of this PUBLIC repo;
// that refactor stripped them from src/layers/*.ts and missed the tests here;
// * one asserted, as correct, the cost-fabrication behaviour a published retraction
// exists to prevent — had it run, it would have BLOCKED the fix;
// * two were unit tests making live Supabase calls on a fail-open path, so their
// verdict tracked network conditions.
//
// A hand-maintained root list fails silently and in the safe-looking direction: a new
// `src/foo/__tests__` is simply never run and every suite stays green. Rooting at
// `src` means the next one is picked up with no config change and no one to remember.
// `testMatch: ['**/*.test.ts']` keeps the scope to test files only; verified there are
// no `*.test.ts` under src outside a `__tests__` directory.
roots: ['<rootDir>/tests', '<rootDir>/src'],
testMatch: ['**/*.test.ts'],
testPathIgnorePatterns: [
'/node_modules/',
'/dist/',
'<rootDir>/tests/integration/'
],
moduleNameMapper: {
'^@xenova/transformers$': '<rootDir>/tests/__mocks__/xenova-stub.js'
}
};