From 4e1d5a28ccf5c5d0af5b93e5d2d7149393b377ad Mon Sep 17 00:00:00 2001 From: AndreGCX Date: Tue, 7 Jun 2022 11:02:16 +0100 Subject: [PATCH 1/3] added coverage --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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", From 80ffd99204d93ab8bc3c079b1bdffa3635922b86 Mon Sep 17 00:00:00 2001 From: AndreGCX Date: Tue, 7 Jun 2022 14:44:18 +0100 Subject: [PATCH 2/3] jest config threshold --- jest.config.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/jest.config.js b/jest.config.js index d5a3ae8f..8d09a644 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": 80, + "lines": 80, + "statements": 80 + } + }, coveragePathIgnorePatterns: ['/node_modules/', '\\.json$', '/__tests__/', '/stories/', '/\\.storybook/'], globals: { From 17191be2b2d71a9b14fe9aa7e544b46a31f0c530 Mon Sep 17 00:00:00 2001 From: AndreGCX Date: Tue, 7 Jun 2022 15:03:53 +0100 Subject: [PATCH 3/3] adjust threshold --- jest.config.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jest.config.js b/jest.config.js index 8d09a644..1b6db32f 100644 --- a/jest.config.js +++ b/jest.config.js @@ -45,9 +45,9 @@ module.exports = { coverageThreshold: { "global": { "branches": 70, - "functions": 80, - "lines": 80, - "statements": 80 + "functions": 90, + "lines": 90, + "statements": 90 } }, coveragePathIgnorePatterns: ['/node_modules/', '\\.json$', '/__tests__/', '/stories/', '/\\.storybook/'],