c8 icon indicating copy to clipboard operation
c8 copied to clipboard

Increase Code Quality By Increasing Code Coverage: lib/parse-args.js

Open mcknasty opened this issue 2 years ago • 1 comments

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.

  1. [x] Make sure you have installed the latest version of Node.js
  2. [x] Fork this project on GitHub and clone your fork locally
  3. [x] Create local branches to work within. These should also be created directly from the main branch. Local Fork here.
  4. [x] Make your changes.
  5. [x] Run tests to make sure all is okay (everything should pass except the snapshot).
    1. A complete log of initial test results.
    2. As instructed, ignore snapshot failures. 0 failures
    3. 100 passing in 48 seconds
  6. [x] Now update the snapshot.
    1. A complete log of snapshot test results.
    2. 100 passing in 48 seconds
  7. [x] If all is passing, commit your changes. The log of the commit can be found here.
  8. [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.
  9. [x] Run tests again to make sure all is okay.
    1. A complete log of the final test results.
    2. 100 passing in 48 seconds
  10. [x] Push
  11. [x] Open the pull request, see details in the template.
  12. [ ] 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

mcknasty avatar Jan 17 '23 13:01 mcknasty

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

mcknasty avatar Jul 29 '23 20:07 mcknasty