From 5227fe2eb6a0089abaee718fa5c7bff83a5bc855 Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Fri, 25 Aug 2023 08:19:17 +0200 Subject: [PATCH 1/2] chore: generate coverage report in text For people working over SSH, that can't comfortably look at `coverage/index.html`, generate `coverage/coverage.txt` instead. --- tools/@aws-cdk/pkglint/jest.config.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/@aws-cdk/pkglint/jest.config.js b/tools/@aws-cdk/pkglint/jest.config.js index 7bb32293f74e2..c6b4d2f4cc42a 100644 --- a/tools/@aws-cdk/pkglint/jest.config.js +++ b/tools/@aws-cdk/pkglint/jest.config.js @@ -1,4 +1,16 @@ module.exports = { + collectCoverage: true, + coverageReporters: [ + "lcov", + "html", + "text-summary", + ['text', { file: 'coverage/coverage.txt' }] + ], + coveragePathIgnorePatterns: [ + "/lib/.*\\.generated\\.[jt]s", + "/test/.*\\.[jt]s", + ], + testMatch: [ "**/?(*.)+(test).js", ], From 90e414cbb7dc01fee76d76537a9c4da13d3b4dc0 Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Fri, 25 Aug 2023 09:58:39 +0200 Subject: [PATCH 2/2] Name is relative to the coverage directory --- tools/@aws-cdk/cdk-build-tools/config/jest.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/@aws-cdk/cdk-build-tools/config/jest.config.js b/tools/@aws-cdk/cdk-build-tools/config/jest.config.js index 2c7b61cdb6d42..9a93f61e642ba 100644 --- a/tools/@aws-cdk/cdk-build-tools/config/jest.config.js +++ b/tools/@aws-cdk/cdk-build-tools/config/jest.config.js @@ -39,7 +39,7 @@ module.exports = { 'lcov', 'html', 'text-summary', - ['text', { file: 'coverage/coverage.txt' }], + ['text', { file: 'coverage.txt' }], ], coveragePathIgnorePatterns: [ '\\.generated\\.[jt]s$',