Increase Code Quality By Increasing Code Coverage: lib/parse-args.js
Pull Request 447
Increase code quality by increasing code coverage: lib/parse-args.js
refactor: bumping code coverage to 100% for lib/parse-args.js. (#447) test: Adding a test case for NODE_V8_COVERAGE and changing the describe block title. (#447) test: Early exit branch test for hideInstrumenteeArgs function. (#447) test: Adding test for relative paths for relative report directory cli option. (#447) test: Adding test case for relative paths for temporary directory cli option. (#447) test: Adding test for passing node.js arguments to c8. (#447)
Following the Contributions Recommendations here.
- [x] Make sure you have installed the latest version of Node.js
- [x] Fork this project on GitHub and clone your fork locally
- [x] Create local branches to work within. These should also be created directly from the main branch. Local Fork here.
- [x] Make your changes.
- [x] Run tests to make sure all is okay (everything should pass except the snapshot).
- A complete log of initial test results.
- As instructed, ignore snapshot failures. 0 failures
- 100 passing in 48 seconds
- [x] Now update the snapshot.
- A complete log of snapshot test results.
- 100 passing in 48 seconds
- [x] If all is passing, commit your changes. The log of the commit can be found here.
- [x] As a best practice, once you have committed your changes, it is a good idea to use git rebase (not git merge) to synchronize your work with the main repository.
- [x] Run tests again to make sure all is okay.
- A complete log of the final test results.
- 100 passing in 48 seconds
- [x] Push
- [x] Open the pull request, see details in the template.
- [ ] Make any necessary changes after review.
File Code Coverage Matrix Report
| Test Type | File | Statement | Branch | Function | Lines |
|---|---|---|---|---|---|
| Final Test | lib/parse-args.js | 100% | 100% | 100% | 100% |
| Node 14.21.3 | lib/parse-args.js | 100% | 100% | 100% | 100% |
| Node 16.20.2 | lib/parse-args.js | 100% | 100% | 100% | 100% |
| Node 18.19.0 | lib/parse-args.js | 100% | 100% | 100% | 100% |
| Node 20.11.0 | lib/parse-args.js | 100% | 100% | 100% | 100% |
Unit Tests Results
All tests run on Node version 18.19.0
| Test Type | PASS | Tests Passed | Tests Failed | Time |
|---|---|---|---|---|
| Initial Test | :heavy_check_mark: | 100 passing | 0 failures | 48 seconds |
| Snapshot Test | :heavy_check_mark: | 100 passing | 0 failures | 48 seconds |
| Final Test | :heavy_check_mark: | 100 passing | 0 failures | 48 seconds |
Node Version Testing Matrix
| Node Version | PASS | Tests Passed | Tests Failed | Time |
|---|---|---|---|---|
| 14.21.3 | :heavy_check_mark: | 100 passing | 0 failures | 55 seconds |
| 16.20.2 | :heavy_check_mark: | 100 passing | 0 failures | 1 minutes |
| 18.19.0 | :heavy_check_mark: | 100 passing | 0 failures | 55 seconds |
| 20.11.0 | :heavy_check_mark: | 100 passing | 0 failures | 1 minutes |
Referencing Issue #448
Updated 2023-07-29 7:59 PM EST Updated 2023-07-30 11:25 AM EST Updated 2024-01-14 9:03 PM EST
The issue of the check function mentioned above has come up a few times as I have been working on yargs related feature requests and code coverage reports. I outlined the issue as I saw it in #489. Furthermore, merging pull request #436 could change the delta of this pull request a fair amount. I suggest that I outline the various ways of setting the temp directory and then write unit tests against those scenarios. I think we can revisit this issue once these few dependencies are complete.
@bcoe