blob: 87bb1370f3a194bffad9ec189d6a536b376652de (
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
|
const t = require('tap')
t.test('should prune using Arborist', (t) => {
const Prune = t.mock('../../lib/prune.js', {
'@npmcli/arborist': function (args) {
t.ok(args, 'gets options object')
t.ok(args.path, 'gets path option')
this.prune = () => {
t.ok(true, 'prune is called')
}
},
'../../lib/utils/reify-finish.js': (arb) => {
t.ok(arb, 'gets arborist tree')
},
})
const prune = new Prune({
prefix: 'foo',
flatOptions: {
foo: 'bar',
},
})
prune.exec(null, er => {
if (er)
throw er
t.ok(true, 'callback is called')
t.end()
})
})
|