Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGar <gar+gh@danger.computer>2021-09-15 21:12:49 +0300
committerGar <gar+gh@danger.computer>2021-09-16 00:35:22 +0300
commitca792acdd4ba683d8415c88188ec6739033fb4fd (patch)
treef8002f7fced00964ceab7c440a38576d5bf22e60 /test
parent371655a6b0e6664fec67f16cb247cc9f174a5197 (diff)
fix(logs): clean args for failed commands
PR-URL: https://github.com/npm/cli/pull/3761 Credit: @wraithgar Close: #3761 Reviewed-by: @lukekarrys
Diffstat (limited to 'test')
-rw-r--r--test/lib/utils/error-message.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/lib/utils/error-message.js b/test/lib/utils/error-message.js
index d1c67a951..6b2b5c922 100644
--- a/test/lib/utils/error-message.js
+++ b/test/lib/utils/error-message.js
@@ -201,6 +201,17 @@ t.test('default message', t => {
t.end()
})
+t.test('args are cleaned', t => {
+ t.matchSnapshot(errorMessage(Object.assign(new Error('cmd err'), {
+ cmd: 'some command',
+ signal: 'SIGYOLO',
+ args: ['a', 'r', 'g', 's', 'https://evil:password@npmjs.org'],
+ stdout: 'stdout',
+ stderr: 'stderr',
+ }), npm))
+ t.end()
+})
+
t.test('eacces/eperm', t => {
const runTest = (windows, loaded, cachePath, cacheDest) => t => {
if (windows)