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/lib
diff options
context:
space:
mode:
authorGar <gar+gh@danger.computer>2021-06-24 20:04:57 +0300
committerGar <gar+gh@danger.computer>2021-07-29 19:16:31 +0300
commit6a8086e258aa209b877e182db4b75f11de5b291d (patch)
treed24d982c63ba72e34acc32ff9b7ba99d9e6885d4 /lib
parente7e1181702db2cf5d90b0c651ed5372b7ad13c74 (diff)
fix(tests): move more tests to use real npm
This moves a handful of the smaller tests to using the new npm mock that uses the real actual npm object. It also extends the testing surface area of a few tests back down into the actual `process.spawn` that results, instead of anything internal to the code. Some dead code in `lib/test.js` was found during this, as well as an instance of a module throwing a string instead of an error object. PR-URL: https://github.com/npm/cli/pull/3463 Credit: @wraithgar Close: #3463 Reviewed-by: @nlf
Diffstat (limited to 'lib')
-rw-r--r--lib/set.js2
-rw-r--r--lib/test.js10
2 files changed, 1 insertions, 11 deletions
diff --git a/lib/set.js b/lib/set.js
index 74a002cd6..a9f16f3b3 100644
--- a/lib/set.js
+++ b/lib/set.js
@@ -22,7 +22,7 @@ class Set extends BaseCommand {
exec (args, cb) {
if (!args.length)
- return cb(this.usage)
+ return cb(this.usageError())
this.npm.commands.config(['set'].concat(args), cb)
}
}
diff --git a/lib/test.js b/lib/test.js
index e78fdf0c7..8ab1e8582 100644
--- a/lib/test.js
+++ b/lib/test.js
@@ -19,15 +19,5 @@ class Test extends LifecycleCmd {
'script-shell',
]
}
-
- exec (args, cb) {
- super.exec(args, er => {
- if (er && er.code === 'ELIFECYCLE') {
- /* eslint-disable standard/no-callback-literal */
- cb('Test failed. See above for more details.')
- } else
- cb(er)
- })
- }
}
module.exports = Test