blob: fb3c269b7bbdd121441dca45b75287ecdd1b8a9e (
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
|
const t = require('tap')
t.test('unstar', async t => {
t.plan(3)
class Star {
constructor (npm) {
this.npm = npm
}
async exec (args) {
t.same(args, ['pkg'], 'should forward packages')
}
}
const Unstar = t.mock('../../../lib/commands/unstar.js', {
'../../../lib/commands/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')
},
},
})
await unstar.exec(['pkg'])
})
|