We use jest for unit testing in our repo, and include config for code coverage:
collectCoverage: true,
collectCoverageFrom: ['src/**/*.ts', 'infrastructure/**/*.ts'],
Normally this results in CLI output for coverage when running the tests. Recently however we've added Danger JS integration on our PR build, and the plugin we're using to report on Jest tests relies on the --outputFile
switch for the jest command i.e. jest --outputFile test-results.json --json
.
With --outputFile
specified code coverage is still run and results are put in the coverage
directory, but the CLI output doesn't include coverage, only pass / fail information. Is it possible to have both the outputFile and coverage to stdout?