1const t = require('tap') 2const { load: loadMockNpm } = require('../../fixtures/mock-npm') 3 4t.test('should prune using Arborist', async (t) => { 5 t.plan(4) 6 const { npm } = await loadMockNpm(t, { 7 mocks: { 8 '@npmcli/arborist': function (args) { 9 t.ok(args, 'gets options object') 10 t.ok(args.path, 'gets path option') 11 this.prune = () => { 12 t.ok(true, 'prune is called') 13 } 14 }, 15 '{LIB}/utils/reify-finish.js': (arb) => { 16 t.ok(arb, 'gets arborist tree') 17 }, 18 }, 19 }) 20 await npm.exec('prune', []) 21}) 22