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

ll.js « lib « test - github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 45eb4ec95b88fb45f5e7414efc054506e3c9efc0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
const requireInject = require('require-inject')
const t = require('tap')

t.test('ll', t => {
  t.plan(3)

  class LS {
    constructor (npm) {
      this.npm = npm
    }

    exec (args, cb) {
      t.deepEqual(args, ['pkg'], 'should forward args')
      cb()
    }
  }

  const LL = requireInject('../../lib/ll.js', {
    '../../lib/ls.js': LS,
  })
  const ll = new LL({
    config: {
      set: (key, value) => {
        t.equal(key, 'long', 'should set long config value')
        t.equal(value, true, 'should set a truthy value')
      },
    },
  })

  ll.exec(['pkg'], err => {
    if (err)
      throw err
  })
})