summaryrefslogtreecommitdiff
path: root/deps/npm/lib/test.js
blob: 4ef025c4bac50c661ac5b2b7818d603f85def3ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module.exports = test

const testCmd = require('./utils/lifecycle.js').cmd('test')
const usage = require('./utils/usage')

test.usage = usage(
  'test',
  'npm test [-- <args>]'
)

function test (args, cb) {
  testCmd(args, function (er) {
    if (!er) return cb()
    if (er.code === 'ELIFECYCLE') {
      return cb('Test failed.  See above for more details.')
    }
    return cb(er)
  })
}