-
Notifications
You must be signed in to change notification settings - Fork 29.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
process: add CLI opt to hide experimental warnings
Adds a command line option to supress experimental warnings. Currently this cannot be accomplished without supressing all warnings (by using the --no-warnings option). However, once this option is enabled, a user can miss out on essential warnings as this supresses all warnings. This commit adds the --no-experimental-warnings command line option to allow users to ignore warnings they will expect while still being able to monitor unexpected warnings. Fixes: #30810
- Loading branch information
1 parent
38a593b
commit 0693a79
Showing
5 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
test/parallel/test-process-no-emit-experimental-warnings.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Flags: --no-experimental-warnings --expose-internals | ||
'use strict'; | ||
// Test supressing experimental warnings. | ||
const common = require('../common'); | ||
const { hijackStderr, | ||
restoreStderr | ||
} = require('../common/hijackstdio'); | ||
const { emitExperimentalWarning } = require('internal/util'); | ||
|
||
function test() { | ||
hijackStderr(common.mustNotCall('stderr.write must not be called')); | ||
emitExperimentalWarning('testExperimentalWarning'); | ||
restoreStderr(); | ||
} | ||
|
||
test(); |