Skip to content

Latest commit

 

History

History
31 lines (29 loc) · 1.46 KB

File metadata and controls

31 lines (29 loc) · 1.46 KB

Jest coverage bug with identical files

Run the following command twice:

$ npm test -- --coverage

Expected:

------------|----------|----------|----------|----------|----------------|
File        |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
------------|----------|----------|----------|----------|----------------|
All files   |      100 |      100 |      100 |      100 |                |
 a          |      100 |      100 |      100 |      100 |                |
  Header.js |      100 |      100 |      100 |      100 |                |
 b          |      100 |      100 |      100 |      100 |                |
  Header.js |      100 |      100 |      100 |      100 |                |
------------|----------|----------|----------|----------|----------------|

Actual

------------|----------|----------|----------|----------|----------------|
File        |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
------------|----------|----------|----------|----------|----------------|
All files   |     12.5 |        0 |    33.33 |       25 |                |
 a          |      100 |      100 |      100 |      100 |                |
  Header.js |      100 |      100 |      100 |      100 |                |
 b          |        0 |        0 |        0 |        0 |                |
  Header.js |        0 |        0 |        0 |        0 |         1,5,10 |
------------|----------|----------|----------|----------|----------------|