diff --git a/packages/app/jest.config.js b/packages/app/jest.config.js index 8691792362..c018531c3b 100644 --- a/packages/app/jest.config.js +++ b/packages/app/jest.config.js @@ -25,4 +25,15 @@ module.exports = { '^ky$': '/src/__mocks__/ky-universal.ts', }, setupFilesAfterEnv: ['/src/setupTests.tsx'], + // Coverage floor pinned just below measured reality so coverage can only + // ratchet up. Decay below these numbers fails the build. Raise them + // deliberately as coverage improves; never lower them silently. + coverageThreshold: { + global: { + statements: 53, + branches: 37, + functions: 38, + lines: 54, + }, + }, }; diff --git a/packages/common-utils/jest.config.js b/packages/common-utils/jest.config.js index 3af5ab5353..dc20747d91 100644 --- a/packages/common-utils/jest.config.js +++ b/packages/common-utils/jest.config.js @@ -15,4 +15,15 @@ module.exports = { moduleNameMapper: { '@/(.*)$': '/$1', }, + // Coverage floor pinned just below measured reality so coverage can only + // ratchet up. Decay below these numbers fails the build. Raise them + // deliberately as coverage improves; never lower them silently. + coverageThreshold: { + global: { + statements: 86, + branches: 78, + functions: 85, + lines: 86, + }, + }, }; diff --git a/packages/hdx-eval/jest.config.js b/packages/hdx-eval/jest.config.js index 4bdc2f8362..f184265f85 100644 --- a/packages/hdx-eval/jest.config.js +++ b/packages/hdx-eval/jest.config.js @@ -12,4 +12,15 @@ module.exports = { moduleNameMapper: { '@/(.*)$': '/$1', }, + // Coverage floor pinned just below measured reality so coverage can only + // ratchet up. Decay below these numbers fails the build. Raise them + // deliberately as coverage improves; never lower them silently. + coverageThreshold: { + global: { + statements: 70, + branches: 55, + functions: 72, + lines: 71, + }, + }, }; diff --git a/packages/hdx-eval/package.json b/packages/hdx-eval/package.json index 7550f4665e..03e64bddbc 100644 --- a/packages/hdx-eval/package.json +++ b/packages/hdx-eval/package.json @@ -36,7 +36,7 @@ "lint": "npx eslint --quiet . --ext .ts", "lint:fix": "npx eslint . --ext .ts --fix", "ci:lint": "yarn lint && yarn tsc --noEmit", - "ci:unit": "jest --ci --forceExit", + "ci:unit": "jest --ci --coverage --forceExit", "dev:unit": "jest --watch", "viewer": "node scripts/viewer/server.js" }