From 1234a61b522f9995ed6c0f1c0f9cc664d981c3fb Mon Sep 17 00:00:00 2001 From: Sam Lord Date: Tue, 16 Nov 2021 10:22:15 +0000 Subject: [PATCH] Mode c8 configuration from package.json to .c8rc.json refs: https://github.com/TryGhost/Toolbox/issues/117 Simplifies the commands in package.json by adding defaults to the .c8rc.json file --- .c8rc.json | 4 ++++ package.json | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.c8rc.json b/.c8rc.json index b7ffc3da66..3ef2eac7a6 100644 --- a/.c8rc.json +++ b/.c8rc.json @@ -1,4 +1,8 @@ { + "all": true, + "include": [ + "core/{*.js,frontend,server,shared}" + ], "exclude": [ "core/frontend/src/**", "core/frontend/public/**", diff --git a/package.json b/package.json index c04fe0c20a..163eb520d3 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "test": "mocha --require=./test/utils/overrides.js --exit --trace-warnings --recursive --extension=test.js --timeout=60000", "test:all": "yarn test:unit && yarn test:integration && yarn test:e2e && yarn lint", "test:debug": "DEBUG=ghost:test* yarn test", - "test:unit": "c8 --all -n 'core/{*.js,frontend,server,shared}' --reporter text-summary --reporter cobertura mocha --require=./test/utils/overrides.js --exit --trace-warnings --recursive --extension=test.js './test/unit' --timeout=2000", + "test:unit": "c8 --reporter text-summary --reporter cobertura mocha --require=./test/utils/overrides.js --exit --trace-warnings --recursive --extension=test.js './test/unit' --timeout=2000", "test:integration": "mocha --require=./test/utils/overrides.js --exit --trace-warnings --recursive --extension=test.js './test/integration' --timeout=5000", "test:e2e": "mocha --require=./test/utils/overrides.js --exit --trace-warnings --recursive --extension=test.js './test/e2e-api' './test/e2e-frontend' './test/e2e-server' --timeout=10000", "test:regression": "mocha --require=./test/utils/overrides.js --exit --trace-warnings --recursive --extension=test.js './test/regression' --timeout=60000", @@ -37,7 +37,7 @@ "test:int:slow": "yarn test:integration --reporter=mocha-slow-test-reporter", "test:e2e:slow": "yarn test:e2e --reporter=mocha-slow-test-reporter", "test:reg:slow": "mocha --require=./test/utils/overrides.js --exit --trace-warnings --recursive --extension=test.js './test/regression' --timeout=60000 --reporter=mocha-slow-test-reporter", - "cov:unit": "c8 report --all -n 'core/{*.js,frontend,server,shared}' -x 'core/frontend/public' --reporter text --reporter html", + "cov:unit": "c8 report --reporter text --reporter html", "lint:server": "eslint --ignore-path .eslintignore 'core/server/**/*.js' 'core/*.js' '*.js'", "lint:shared": "eslint --ignore-path .eslintignore 'core/shared/**/*.js'", "lint:frontend": "eslint --ignore-path .eslintignore 'core/frontend/**/*.js'",