-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
test: check util.parseArgs argv parsing with actual process execution #61089
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
test: check util.parseArgs argv parsing with actual process execution #61089
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #61089 +/- ##
==========================================
- Coverage 88.53% 88.51% -0.02%
==========================================
Files 703 703
Lines 208546 208546
Branches 40217 40224 +7
==========================================
- Hits 184634 184594 -40
- Misses 15926 15962 +36
- Partials 7986 7990 +4 🚀 New features to boost your workflow:
|
| @@ -1,4 +1,5 @@ | |||
| import { spawnPromisified } from '../common/index.mjs'; | |||
| import { path } from '../common/fixtures.mjs'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: path is usually referring to node:path, it's confusing to have it refer to a function
| import { path } from '../common/fixtures.mjs'; | |
| import * as fixtures from '../common/fixtures.mjs'; |
EDIT: I guess it should be a follow up along with a lint rule
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both patterns are in common use at the moment, I don't mind changing but it will need following up in either case.
|
Landed in 7b7f693 |
The new --eval tests for
util.parseArgs()are genuine usage tests that spawn a node instance with command-line args, whereas the existing test for "command-line parsing" just overwritesprocess.argv. Mocking this property is fine for the input parsing tests, but the command-line behaviour should also be genuinely tested here.Refs: #60814