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
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2020-05-28 20:28:11 +0300
committerisaacs <i@izs.me>2020-05-28 20:41:53 +0300
commitf1724f457a9e84c7f5c89b6439ef0ab6f482c3c6 (patch)
tree6668dceece89ecb8a2da2960e36a929fc256d3a2 /lib/install-ci-test.js
parent82aca875849357bd331f039dca77aa8d4331d8f6 (diff)
ci-test, install-test: consistent cmd code pattern
No functional change. Just updating the code style for install-ci-test.js and install-test.js to match other commands.
Diffstat (limited to 'lib/install-ci-test.js')
-rw-r--r--lib/install-ci-test.js27
1 files changed, 10 insertions, 17 deletions
diff --git a/lib/install-ci-test.js b/lib/install-ci-test.js
index 26120f4a2..52c41c413 100644
--- a/lib/install-ci-test.js
+++ b/lib/install-ci-test.js
@@ -1,26 +1,19 @@
-'use strict'
-
// npm install-ci-test
// Runs `npm ci` and then runs `npm test`
-module.exports = installTest
-var ci = require('./ci.js')
-var test = require('./test.js')
-var usage = require('./utils/usage')
+const ci = require('./ci.js')
+const test = require('./test.js')
+const usageUtil = require('./utils/usage.js')
-installTest.usage = usage(
+const usage = usageUtil(
'install-ci-test',
- '\nnpm install-ci-test [args]' +
+ 'npm install-ci-test [args]' +
'\nSame args as `npm ci`'
)
-installTest.completion = ci.completion
+const completion = ci.completion
+
+const ciTest = (args, cb) =>
+ ci(args, er => er ? cb(er) : test([], cb))
-function installTest (args, cb) {
- ci(args, function (er) {
- if (er) {
- return cb(er)
- }
- test([], cb)
- })
-}
+module.exports = Object.assign(ciTest, { usage, completion })