diff --git a/.gitignore b/.gitignore index 3994a5fa38..23eea89567 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ lib-cov # Coverage directory used by tools like istanbul coverage +coverage-e2e # nyc test coverage .nyc_output diff --git a/ghost/core/.c8rc.e2e.json b/ghost/core/.c8rc.e2e.json new file mode 100644 index 0000000000..711e197f1b --- /dev/null +++ b/ghost/core/.c8rc.e2e.json @@ -0,0 +1,21 @@ +{ + "all": true, + "check-coverage": true, + "reporter": [ + "html-spa", + "text-summary", + "cobertura" + ], + "reportsDir": "./coverage-e2e", + "statements": 78, + "branches": 80, + "functions": 80, + "lines": 78, + "include": [ + "core/{*.js,frontend,server,shared}" + ], + "exclude": [ + "core/server/data/migrations/**", + "!core/server/data/migrations/utils.js" + ] +} diff --git a/ghost/core/.c8rc.json b/ghost/core/.c8rc.json index 277e9c146d..03fa6fb477 100644 --- a/ghost/core/.c8rc.json +++ b/ghost/core/.c8rc.json @@ -7,7 +7,7 @@ "cobertura" ], "statements": 61, - "branches": 80, + "branches": 85, "functions": 51, "lines": 61, "include": [ diff --git a/ghost/core/package.json b/ghost/core/package.json index 79fa9fe0c7..4e82097281 100644 --- a/ghost/core/package.json +++ b/ghost/core/package.json @@ -33,7 +33,8 @@ "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": "c8 yarn test:e2e -b && yarn test:integration -b && yarn test:regression -b", + "test:ci": "c8 -c ./.c8rc.e2e.json yarn test:ci:base", + "test:ci:base": "yarn test:e2e -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",