Rerun Test Coverage Multiple Times Produce Different Coverage Results
See original GitHub issueLink to bug demonstration repository
I’ve followed this link in nyc npm, since we use typescript
Run tests multiple times with test coverage enabled results in different results-
Expected Behavior

Observed Behavior
Half times is 85%

Half times is 68%

Interesting fact When the percentage is higher, which is correct, I could see each code file coverage But when the percentage is lower, which is incorrect, when I click each code file, some files instead of showing the code and coverage for each line, shows below message

Troubleshooting steps
- still occurring when I put
cache: falsein my nyc config This does nothing for me
Environment Information
# paste the output here
System:
OS: macOS 10.14.4
CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Memory: 567.67 MB / 16.00 GB
Binaries:
Node: 12.3.1 - /usr/local/bin/node
Yarn: 1.16.0 - /usr/local/bin/yarn
npm: 6.9.0 - /usr/local/bin/npm
npmPackages:
nyc: ^14.1.1 => 14.1.1
source-map-support: ^0.5.12 => 0.5.12
ts-node: ^8.1.0 => 8.2.0
typescript: ^3.1.1 => 3.5.1
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Troubleshooting Code Coverage - Visual Studio (Windows)
When you modify and rerun your tests, a previous code coverage result can still be visible, including the code coloring from that old...
Read more >How to rerun failed test cases and add coverage in previous ...
After i rerun the failed testcases , the test cases passed but then after new coverage came for these failed test cases. I...
Read more >Use Continuous Testing | dotCover Documentation - JetBrains
dotCover tutorial, how to run continuous testing, test driven ... Coverage results will be shown in a separate Unit Tests Coverage window.
Read more >Collect Coverage in Tests - MATLAB & Simulink - MathWorks
To aggregate results from different test files into a single result set, select the separate results in the Results and Artifacts list. Then,...
Read more >CS253 | Lab / Coverage - Colorado State University
People have a natural tendency to test only the parts of the code that they're ... It tells you how many times each...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I may have a solution :
.nycrc@godu thank you so much! It works