Files
iptvnator/jest.preset.js
T
4grayandClaude Opus 5.5 e8902f472a perf(ci): skip unit coverage on PRs that cannot reach it and persist the Jest cache (#1711)
Pull requests whose changes cannot reach any Tier A test (allowlist checked against declared Tier A inputs and an AST scan of cross-project reads) skip the unit coverage suite; master pushes always run it. Jest's transform cache is persisted with actions/cache: PRs restore only, master pushes start empty and save. Paired CI runs: Tier A 9m04s cold -> 6m09s warm. Nx Cloud is intentionally not used.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-27 07:50:07 +02:00

28 lines
804 B
JavaScript

const nxPreset = require('@nx/jest/preset').default;
const coverageReporters = ['json', 'json-summary', 'lcovonly', 'text-summary'];
const collectCoverageFrom = [
'src/**/*.{ts,js,mjs,html}',
'!src/**/*.{spec,test}.ts',
'!src/**/test-setup.ts',
'!src/**/test-stubs/**',
'!src/**/*.generated.*',
'!src/**/environments/**',
'!src/**/index.ts',
];
// CI points every Jest run at one directory (JEST_CACHE_DIRECTORY) so the
// transform cache can be persisted between workflow runs; unset, Jest keeps
// its default per-user temp directory.
const cacheDirectory = process.env.JEST_CACHE_DIRECTORY
? { cacheDirectory: process.env.JEST_CACHE_DIRECTORY }
: {};
module.exports = {
...nxPreset,
...cacheDirectory,
coverageReporters,
collectCoverageFrom,
};