• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1var path = require('path')
2var test = require('tap').test
3var rimraf = require('rimraf')
4var common = require('../common-tap.js')
5var opts = { cwd: common.pkg }
6var binDir = '../../../node_modules/.bin'
7var fixture = path.resolve(common.pkg, binDir)
8
9test('setup', function (t) {
10  rimraf.sync(path.join(common.pkg, 'node_modules'))
11  t.end()
12})
13
14test('npm bin', function (t) {
15  common.npm(['bin'], opts, function (err, code, stdout, stderr) {
16    t.ifError(err, 'bin ran without issue')
17    t.notOk(stderr, 'should have no stderr')
18    t.equal(code, 0, 'exit ok')
19    var res = path.resolve(stdout)
20    t.equal(res, fixture + '\n')
21    t.end()
22  })
23})
24