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

find-dupes.js « lib « test « npm « deps - github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 17940764b94a5928c6939bd5842f59312af3045d (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
const t = require('tap')

const { real: mockNpm } = require('../fixtures/mock-npm')

t.test('should run dedupe in dryRun mode', async (t) => {
  t.plan(5)
  const { npm, command } = mockNpm(t, {
    '@npmcli/arborist': function (args) {
      t.ok(args, 'gets options object')
      t.ok(args.path, 'gets path option')
      t.ok(args.dryRun, 'is called in dryRun mode')
      this.dedupe = () => {
        t.ok(true, 'dedupe is called')
      }
    },
    '../../lib/utils/reify-finish.js': (npm, arb) => {
      t.ok(arb, 'gets arborist tree')
    },
  })
  await npm.load()
  // explicitly set to false so we can be 100% sure it's always true when it
  // hits arborist
  npm.config.set('dry-run', false)
  npm.config.set('prefix', 'foo')
  await command('find-dupes')
})