Files
siop2/apps/api/jest.config.js
pr-daaif 83efc33f0f ci(r0.12): pipeline GitHub Actions — ci-contract, api (couverture ≥ 70 %), web
- ci-contract : régénère docs/openapi.json + schema.d.ts et échoue au
  moindre diff — la règle d'or (ADR-001) devient bloquante
- api : services PostgreSQL 18 + Redis, prisma migrate deploy, typecheck,
  Jest avec coverageThreshold global 70 % (mesuré : 97,5 % stmts / 90,7 % branches)
- web : typecheck + vitest + build de production
- test unitaire PermissionsGuard (23 tests au total) ; badge CI au README

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-15 22:24:59 +01:00

19 lines
672 B
JavaScript

/** @type {import('jest').Config} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
rootDir: '.',
testMatch: ['<rootDir>/src/**/*.spec.ts', '<rootDir>/test/**/*.e2e-spec.ts'],
moduleNameMapper: {
// Les tests consomment la source du contrat, pas le dist
'^@siop/shared$': '<rootDir>/../../packages/shared/src/index.ts',
},
setupFiles: ['<rootDir>/test/setup-env.ts'],
collectCoverageFrom: ['src/**/*.ts', '!src/main.ts'],
// Exigence non fonctionnelle (01-cadrage) : couverture backend ≥ 70 % BLOQUANTE
coverageThreshold: {
global: { statements: 70, branches: 70, functions: 70, lines: 70 },
},
testTimeout: 30000,
};