diff --git a/jest.config.js b/jest.config.js index d5a3ae8f..1b6db32f 100644 --- a/jest.config.js +++ b/jest.config.js @@ -40,8 +40,16 @@ module.exports = { // setupFiles: [`${__dirname}/setup/setup.js`], // setupFilesAfterEnv: [`${__dirname}/setup/setupAfterEnv.ts`], // coverage settings - collectCoverage: NO_COVERAGE === false, - collectCoverageFrom: NO_COVERAGE ? [] : ['**/*.{ts,tsx}', '!**/*.d.ts', '!**/node_modules/**'], + collectCoverage: true, + collectCoverageFrom: ['**/*.{ts,tsx}', '!**/*.d.ts', '!**/node_modules/**'], + coverageThreshold: { + "global": { + "branches": 70, + "functions": 90, + "lines": 90, + "statements": 90 + } + }, coveragePathIgnorePatterns: ['/node_modules/', '\\.json$', '/__tests__/', '/stories/', '/\\.storybook/'], globals: { diff --git a/package.json b/package.json index 02d3b228..bc649ad6 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "scripts": { "build": "tsc", "postbuild": "copyfiles -u 1 src/main/wrapper/resources/cx* dist/", - "test": "tsc && jest --runInBand" + "test": "tsc && jest --runInBand --coverage" }, "repository": "https://github.com/CheckmarxDev/ast-cli-javascript-wrapper.git", "author": "Jay Nanduri",