nyc
nyc copied to clipboard
Tags import statements as uncovered lines
Link to bug demonstration repository
https://github.com/aptivator/ttt-engine-heuristic-nyc-issue
run npm run test:coverage to see nyc output
run npm test:coverage:c8 to see c8 output
Expected Behavior
All lines should be shown as covered (output from c8):
| File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
|---|---|---|---|---|---|
| All files | 100 | 100 | 100 | 100 | |
| src | 100 | 100 | 100 | 100 | |
| index.js | 100 | 100 | 100 | 100 | |
| src/_lib | 100 | 100 | 100 | 100 | |
| ttt-utils.js | 100 | 100 | 100 | 100 | |
| utils.js | 100 | 100 | 100 | 100 | |
| vars.js | 100 | 100 | 100 | 100 | |
| src/play-actions | 100 | 100 | 100 | 100 | |
| play-actions.js | 100 | 100 | 100 | 100 | |
| src/play-actions/_lib | 100 | 100 | 100 | 100 | |
| play-actions-vars.js | 100 | 100 | 100 | 100 |
Observed Behavior
The last of the imports of the assessed files are shown as uncovered:
| File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
|---|---|---|---|---|---|
| All files | 100 | 81.25 | 100 | 100 | |
| src | 100 | 70 | 100 | 100 | |
| index.js | 100 | 70 | 100 | 100 | 2 |
| src/_lib | 100 | 81.25 | 100 | 100 | |
| ttt-utils.js | 100 | 81.25 | 100 | 100 | 2 |
| utils.js | 100 | 100 | 100 | 100 | |
| vars.js | 100 | 100 | 100 | 100 | |
| src/play-actions | 100 | 85 | 100 | 100 | |
| play-actions.js | 100 | 85 | 100 | 100 | 5 |
| src/play-actions/_lib | 100 | 100 | 100 | 100 | |
| play-actions-vars.js | 100 | 100 | 100 | 100 |
Troubleshooting steps
- [x] still occurring when I put
cache: falsein my nyc config
Environment Information
System:
OS: Linux 4.15 Ubuntu 16.04.3 LTS (Xenial Xerus)
CPU: (8) x64 Intel(R) Core(TM) i7-3840QM CPU @ 2.80GHz
Memory: 19.47 GB / 23.48 GB
Binaries:
Node: 17.4.0 - ~/.nvm/versions/node/v17.4.0/bin/node
npm: 8.3.1 - ~/.nvm/versions/node/v17.4.0/bin/npm
npmPackages:
@babel/cli: ^7.10.5 => 7.19.3
@babel/core: ^7.11.1 => 7.20.5
@babel/node: ^7.10.5 => 7.20.5
@babel/preset-env: ^7.11.0 => 7.20.2
@babel/register: ^7.10.5 => 7.18.9
@rollup/plugin-babel: ^5.3.1 => 5.3.1
nyc: ^15.1.0 => 15.1.0