You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am attempting to run a Jest integration/unit test suite in three parts using the shard flag), then merging the coverage report using nyc merge on the individual shard reports. I expect that the coverage report generated from nyc merge should match the coverage report I get from running the entire test suite at once.
Observed Behavior
The branch coverage generated from nyc merge is slightly underreported.
Example of the branch coverage reported by nyc merge:
Example of the branch coverage reported by running the entire test suite:
The merged coverage report incorrectly shows that the different branches are not covered, even though the individual lines are taken are of.
Troubleshooting steps
still occurring when I put cache: false in my nyc config
Generate the individual shards using this: node --expose-gc --no-compilation-cache $(yarn bin jest) --ci --colors --logHeapUsage --reporters=default --reporters=github-actions --reporters=jest-junit --coverage --coverageReporters=cobertura --coverageReporters=text-summary --coverageReporters=html --coverageReporters=json --shard=X/3
Move the coverage-final.json files from each shard into the same folder
Run nyc merge shardcoverage nycoutput/output.json and nyc report -t nycoutput --report-dir final-report --reporter=lcov --reporter=text-summary --reporter=cobertura --reporter=html
Expected Behavior
I am attempting to run a Jest integration/unit test suite in three parts using the shard flag), then merging the coverage report using
nyc merge
on the individual shard reports. I expect that the coverage report generated fromnyc merge
should match the coverage report I get from running the entire test suite at once.Observed Behavior
The branch coverage generated from
nyc merge
is slightly underreported.Example of the branch coverage reported by
nyc merge
:Example of the branch coverage reported by running the entire test suite:
The merged coverage report incorrectly shows that the different branches are not covered, even though the individual lines are taken are of.
Troubleshooting steps
cache: false
in my nyc confignode --expose-gc --no-compilation-cache $(yarn bin jest) --ci --colors --logHeapUsage --reporters=default --reporters=github-actions --reporters=jest-junit --coverage --coverageReporters=cobertura --coverageReporters=text-summary --coverageReporters=html --coverageReporters=json --shard=X/3
coverage-final.json
files from each shard into the same foldernyc merge shardcoverage nycoutput/output.json
andnyc report -t nycoutput --report-dir final-report --reporter=lcov --reporter=text-summary --reporter=cobertura --reporter=html
.nycrc:
Environment Information
The text was updated successfully, but these errors were encountered: