-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
src: improve parsing of boolean options #58039
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
base: main
Are you sure you want to change the base?
Conversation
Review requested:
|
bf2dcc5
to
01cedaa
Compare
cc @avivkeller |
This allows passing |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #58039 +/- ##
==========================================
- Coverage 90.26% 90.26% -0.01%
==========================================
Files 630 630
Lines 186159 186329 +170
Branches 36474 36505 +31
==========================================
+ Hits 168036 168182 +146
- Misses 10974 11005 +31
+ Partials 7149 7142 -7
🚀 New features to boost your workflow:
|
test('--inspect=true should be parsed correctly', { skip: !process.features.inspector }, async () => { | ||
const result = await spawnPromisified(process.execPath, [ | ||
'--no-warnings', | ||
'--expose-internals', |
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.
Why use the internals and not the normal --inspect
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.
I used the same test structure. internals is used to get the option value
require("internal/options").getOptionValue("--inspect")
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.
Im think you can just do require('node:inspector').url()
without exposing internals
LGTM with the |
Refs #57960
This PR changes the way booleans are parsed from the config file. Instead of setting
--flag=true|false
, it adds or not the flag to the options