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

unstar.js « lib « test - github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8b853230a6c8b44c5ae33b92ef010719d774e287 (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
const t = require('tap')

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

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

    exec (args, cb) {
      t.same(args, ['pkg'], 'should forward packages')
      cb()
    }
  }
  const Unstar = t.mock('../../lib/unstar.js', {
    '../../lib/star.js': Star,
  })

  const unstar = new Unstar({
    config: {
      set: (key, value) => {
        t.equal(key, 'star.unstar', 'should set unstar config value')
        t.equal(value, true, 'should set a truthy value')
      },
    },
  })

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