c8
c8 copied to clipboard
Unreached lines of code in lib/parse-args.js
- Version:
- Platform:
- Version:
$ node -v
v16.19.1
- Platform:
$ uname -a
Linux ********* 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
The variable argv.tempDirectory is set in the following yargs function
The lines in the file lib/parse-args.js is not reached during the test cases and it references this variable.
| File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
|---|---|---|---|---|---|
| All files | 95.84 | 86.33 | 100 | 95.84 | |
| bin | 90.38 | 88.88 | 100 | 90.38 | |
| c8.js | 90.38 | 88.88 | 100 | 90.38 | 27-29,50-51 |
| lib | 95.6 | 84.25 | 100 | 95.6 | |
| is-cjs-esm-bridge.js | 90 | 62.5 | 100 | 90 | 9 |
| parse-args.js | 98.21 | 75 | 100 | 98.21 | 165-166,201-202 |
| report.js | 95.44 | 90.54 | 100 | 95.44 | 9-10,123,129-132,143-147,248-249,332-333,367-369 |
| source-map-from-file.js | 91 | 71.42 | 100 | 91 | 74-76,91-93,95-97 |
| lib/commands | 100 | 95.45 | 100 | 100 | |
| check-coverage.js | 100 | 92.85 | 100 | 100 | 26 |
| report.js | 100 | 100 | 100 | 100 |
The variable process.env.NODE_V8_COVERAGE is used as the default for argv.tempDirectory on lines 127 - 130 in lib/parse-args.js. Oddly enough process.env.NODE_V8_COVERAGE is assigned the value of the variable argv.tempDirectory on line of 36 of
bin/c8.js.
Need to investigate this issue further. Taking some notes as it is referenced in #436