diff options
author | Gar <gar+gh@danger.computer> | 2021-06-24 20:04:57 +0300 |
---|---|---|
committer | Gar <gar+gh@danger.computer> | 2021-07-29 19:16:31 +0300 |
commit | 6a8086e258aa209b877e182db4b75f11de5b291d (patch) | |
tree | d24d982c63ba72e34acc32ff9b7ba99d9e6885d4 /lib | |
parent | e7e1181702db2cf5d90b0c651ed5372b7ad13c74 (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.js | 2 | ||||
-rw-r--r-- | lib/test.js | 10 |
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 |