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

root.js « lib « test « npm « deps - github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5460f3d4985c22cbaeac18190e32255fa4dd7dfd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
const t = require('tap')

t.test('root', (t) => {
  t.plan(3)
  const dir = '/root/dir'

  const Root = require('../../lib/root.js')
  const root = new Root({
    dir,
    output: (output) => {
      t.equal(output, dir, 'prints the correct directory')
    },
  })

  root.exec([], (err) => {
    t.error(err, 'npm root')
    t.ok('should have printed directory')
  })
})