Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancing tests of config parse - Rebuilt #8

Open
wants to merge 4 commits into
base: additional-config-files
Choose a base branch
from

Conversation

kf6kjg
Copy link
Collaborator

@kf6kjg kf6kjg commented Feb 2, 2024

This is an upgraded version of #5

I incorporated a lot of @mcknasty's suggestions and even went further by enhancing the error API and testing it, plus several other minor cleanups, comments, and JSDoc additions.

mcknasty and others added 4 commits February 2, 2024 10:16
feat: Adding additional configuration file options
test: unit test for config file detection
test: unit test for config files pass via the cli
test: unit test case for early exit of hideInstrumenteeArgs
test: unit test for Node.js argument handling
fix: bug in spawning of c8 process that dropped coverage significantly
Logically these are not part of the argument parsing. They are configuration loading and validation. Having them in the parse-args module was only making the file and the tests harder to work with.

This change only has two semantic differences:
1. The list of known config files names was converted to a const immutable array instead of beating a mutable array returned by a function.
2. The parse-args file is no longer exporting those two internal utility functions, instead the equivalents are coming from a dedicated file.
Specifically:
- Handling the cases of empty files and files that have simple forms of improper content.
- Reporting easier to understand errors when the parsers fail.

Adding schema validators was deemed beyond the scope of this particular commit, though notes were added for where they should be added.

Incorporated many of mcknasty's suggestions. However I didn't keep them all, and many other elements were reinterpreted.
@kf6kjg kf6kjg requested a review from mcknasty February 2, 2024 19:03
@kf6kjg kf6kjg mentioned this pull request Feb 2, 2024
3 tasks
@kf6kjg
Copy link
Collaborator Author

kf6kjg commented Feb 2, 2024

Locally npm ci and the entire test suite works in nodes 14-20 on MacOS:

$ npm -v; node -v
6.14.18
v14.21.3
$ npm ci         
npm WARN prepare removing existing node_modules/ before installation
added 384 packages in 2.167s

$ npm -v; node -v
8.19.4
v16.20.2
$ npm ci

added 384 packages, and audited 385 packages in 3s

98 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

$ npm -v; node -v
10.2.3
v18.19.0
$ npm ci         

added 384 packages, and audited 385 packages in 2s

98 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

$ npm -v; node -v
10.2.4
v20.11.0
$ npm ci

added 384 packages, and audited 385 packages in 2s

98 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

@kf6kjg kf6kjg mentioned this pull request Feb 2, 2024
4 tasks
@mcknasty
Copy link
Owner

mcknasty commented Feb 3, 2024

This is looking really good. This is based on the branch I created and this pull request. It should have all your changes from this morning. I need to clean up the commit log a bit more. I was going to add my name to your last commit, if you don't mind, due to some of the work on the test cases, being the original branch owner.

@mcknasty mcknasty force-pushed the additional-config-files branch 2 times, most recently from fd3e9d4 to 6ff250f Compare June 14, 2024 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants