0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00

Configured c8 to use all source files

no issue

- by default, `c8` will only show stats for files that were loaded during execution
- this means the coverage stats are too high because we're not taking
  into account all the files not loaded by tests
- this commit append the `--all` flag to `c8` which fixes this
This commit is contained in:
Daniel Lockyer 2021-08-26 13:38:33 +02:00
parent 51d602d5b3
commit 070a6ac13c

View file

@ -29,11 +29,11 @@
"test": "mocha --require=./test/utils/overrides.js --exit --trace-warnings --recursive --extension=test.js --timeout=60000",
"test:all": "yarn test:unit && yarn test:acceptance && yarn lint",
"test:debug": "DEBUG=ghost:test* yarn test",
"test:unit": "c8 --reporter text-summary mocha --require=./test/utils/overrides.js --exit --trace-warnings --recursive --extension=test.js './test/unit' --timeout=2000",
"test:unit": "c8 --all -n 'core/{*.js,frontend,server,shared}' --reporter text-summary mocha --require=./test/utils/overrides.js --exit --trace-warnings --recursive --extension=test.js './test/unit' --timeout=2000",
"test:acceptance": "mocha --require=./test/utils/overrides.js --exit --trace-warnings --recursive --extension=test.js './test/api-acceptance' './test/frontend-acceptance' --timeout=10000",
"test:regression": "mocha --require=./test/utils/overrides.js --exit --trace-warnings --recursive --extension=test.js './test/regression' --timeout=60000",
"test:slow": "yarn test:unit --reporter=mocha-slow-test-reporter && yarn test:acceptance --reporter=mocha-slow-test-reporter",
"coverage:unit": "c8 report",
"coverage:unit": "c8 report --all -n 'core/{*.js,frontend,server,shared}' --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'",