gotwarlost / istanbul

Yet another JS code coverage tool that computes statement, line, function and branch coverage with module loader hooks to transparently add coverage when running tests. Supports all JS coverage use cases including unit tests, server side functional tests and browser tests. Built for scale.
Other
8.7k stars 786 forks source link

coverage % changes when no code change occurred #824

Closed epikhighs closed 7 years ago

epikhighs commented 7 years ago

Even though I do not make any code change, I get slight variations in coverage % if i run the coverage multiple times. Does anyone know why this might be?

The only thing I can think of is perhaps babel is messing with with the output, but in another project we don't use babel and I get diff results if I run multiple test runs.

File                         |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
-----------------------------|----------|----------|----------|----------|----------------|
All files                    |    49.26 |    33.48 |     40.4 |     49.5 |                |

-----------------------------|----------|----------|----------|----------|----------------|
File                         |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
-----------------------------|----------|----------|----------|----------|----------------|
All files                    |     49.9 |    31.17 |    41.98 |    50.44 |                |
pebie commented 6 years ago

Same issue here. What is your solution @epikhighs ?

epikhighs commented 6 years ago

@pebie refer to my comment https://github.com/istanbuljs/nyc/issues/630

GL