diff options
author | isaacs <i@izs.me> | 2021-02-20 07:39:12 +0300 |
---|---|---|
committer | isaacs <i@izs.me> | 2021-02-22 23:30:12 +0300 |
commit | 4e58274ed0fd2dd29d3c8d6c7c47f37a37dc0f0f (patch) | |
tree | a3e88314ceb246257252307985846a926e839872 /test/lib/npm.js | |
parent | be9f1525587d70c909da88b996220b374583d42a (diff) |
Do not print error banner for shell proxy commands
There are a few commands (exec, run-script, and the run-script proxies)
where essentially npm is acting like a very fancy shell. It is peculiar
and noisy for npm to print a verbose error banner at the end of these
commands, since presumably the command itself already did whatever it
had to do to report the error appropriately.
For example, `npm test` runs a test script, usually outputting test
results. Having npm then tell me that my tests failed with exit status
1 and print a debug log, is unnecessary and unwanted.
When the error encountered for these commands does not have a non-zero
numeric 'code', then we still print the standard npm error reporting
messages, because presumably something went wrong OTHER than a process
exiting with a non-zero status code.
PR-URL: https://github.com/npm/cli/pull/2742
Credit: @isaacs
Close: #2742
Reviewed-by: @nlf
Diffstat (limited to 'test/lib/npm.js')
-rw-r--r-- | test/lib/npm.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/test/lib/npm.js b/test/lib/npm.js index 8494af6bb..9fd9888b9 100644 --- a/test/lib/npm.js +++ b/test/lib/npm.js @@ -79,6 +79,7 @@ t.test('not yet loaded', t => { set: Function, }, version: String, + shelloutCommands: Array, }) t.throws(() => npm.config.set('foo', 'bar')) t.throws(() => npm.config.get('foo')) |