From b7951b54456a0df2449886c61af07db6199eab74 Mon Sep 17 00:00:00 2001 From: Naz Date: Mon, 14 Nov 2022 16:31:48 +0700 Subject: [PATCH] Enabled test coverage report for e2e tests closes https://github.com/TryGhost/Toolbox/issues/475 - We did not have visibility and history into test coverage statistics in non-unit test suites. This data is useful identifying problematic areas and can be used to keep the code quality under control - Enabled test coverage for e2e tests, including integration and regression tests - Decreased the "branches" coverage requirement for the tests to pass (did not want to introduce an additional c8 configuration file just yet) --- ghost/core/.c8rc.json | 2 +- ghost/core/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ghost/core/.c8rc.json b/ghost/core/.c8rc.json index 5e4be32a62..c00b46b288 100644 --- a/ghost/core/.c8rc.json +++ b/ghost/core/.c8rc.json @@ -7,7 +7,7 @@ "cobertura" ], "statements": 57, - "branches": 85, + "branches": 80, "functions": 51, "lines": 57, "include": [ diff --git a/ghost/core/package.json b/ghost/core/package.json index b415c9c3e9..79fa9fe0c7 100644 --- a/ghost/core/package.json +++ b/ghost/core/package.json @@ -33,7 +33,7 @@ "test:e2e": "mocha --require=./test/utils/overrides.js --exit --trace-warnings --recursive --extension=test.js './test/e2e-api' './test/e2e-frontend' './test/e2e-server' './test/e2e-webhooks' --timeout=15000", "test:regression": "mocha --require=./test/utils/overrides.js --exit --trace-warnings --recursive --extension=test.js './test/regression' --timeout=60000", "test:browser": "playwright test --browser=all test/e2e-browser", - "test:ci": "yarn test:e2e -b && yarn test:integration -b && yarn test:regression -b", + "test:ci": "c8 yarn test:e2e -b && yarn test:integration -b && yarn test:regression -b", "test:unit:slow": "yarn test:unit --reporter=mocha-slow-test-reporter", "test:int:slow": "yarn test:integration --reporter=mocha-slow-test-reporter", "test:e2e:slow": "yarn test:e2e --reporter=mocha-slow-test-reporter",