-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
src,test: fix config file parsing for flags defaulted to true #59110
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
src,test: fix config file parsing for flags defaulted to true #59110
Conversation
Review requested:
|
50c110b
to
377dcb3
Compare
ce7ca6f
to
99ef802
Compare
Failed to start CI⚠ No approving reviews found ✘ Refusing to run CI on potentially unsafe PRhttps://github.com/nodejs/node/actions/runs/16362374774 |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #59110 +/- ##
==========================================
- Coverage 90.05% 90.05% -0.01%
==========================================
Files 645 645
Lines 189153 189155 +2
Branches 37093 37100 +7
==========================================
- Hits 170339 170338 -1
- Misses 11518 11523 +5
+ Partials 7296 7294 -2
🚀 New features to boost your workflow:
|
This comment was marked as outdated.
This comment was marked as outdated.
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.
W00t, thanks!
test('should parse boolean flag defaulted to true', async () => { | ||
const result = await spawnPromisified(process.execPath, [ | ||
'--experimental-config-file', |
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.
Very minor nit: we can also expose internals in order to directly verify the value of the option that we're setting. This might help decouple the option behaviour from the test. In this case, we're using the behaviour of process.emitWarning
to validate that --no-warnings
has been correctly managed.
Landed in ab694d5 |
PR-URL: #59110 Reviewed-By: Pietro Marchini <[email protected]> Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: Jacob Smith <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
Fixes #58929
This PR fixes config file parsing for boolean options that are enabled by default.
In my last PR, I did a quick fix for boolean values. Such a fix missed the case where the flag is
true
by default, as--warnings
. To ensure we're disabling a flag, we have to output that flag prefixed with--no-
.