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

load-all-commands.js « lib « test « npm « deps - github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: fa73b8a78d8fa2a721ed7a0d0e493855e428aefe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// just for gathering coverage info
const npm = require('../../lib/npm.js')
const t = require('tap')
const { cmdList } = require('../../lib/utils/cmd-list.js')

t.test('load npm', t => npm.load(er => {
  if (er)
    throw er
}))

t.test('load each command', t => {
  t.plan(cmdList.length)
  for (const cmd of cmdList.sort((a, b) => a.localeCompare(b))) {
    t.test(cmd, t => {
      t.plan(3)
      const impl = npm.commands[cmd]
      t.isa(impl, 'function', 'implementation is a function')
      t.isa(impl.usage, 'string', 'usage is a string')
      t.isa(impl.completion, 'function', 'completion is a function')
    })
  }
})