Files
Kmake/deps/npm/test/lib/commands/prune.js
2026-05-26 23:36:42 -07:00

22 lines
570 B
JavaScript

const t = require('tap')
const { load: loadMockNpm } = require('../../fixtures/mock-npm')
t.test('should prune using Arborist', async (t) => {
t.plan(4)
const { npm } = await loadMockNpm(t, {
mocks: {
'@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')
},
},
})
await npm.exec('prune', [])
})