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

lifecycle-cmd.js « utils « lib « test « npm « deps - github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3928c1b26e8f334b0543ce75fd76f0db65b138c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
const t = require('tap')
const lifecycleCmd = require('../../../lib/utils/lifecycle-cmd.js')
const npm = {
  commands: {
    'run-script': (args, cb) => cb(null, 'called npm.commands.run'),
  },
}
t.test('create a lifecycle command', t => {
  const cmd = lifecycleCmd(npm, 'asdf')
  cmd(['some', 'args'], (er, result) => {
    t.strictSame(result, 'called npm.commands.run')
    t.end()
  })
})