summaryrefslogtreecommitdiff
path: root/deps/npm/test/tap/spawn-enoent-help.js
blob: d4a6fcdd832ad586683c874244f81b880ffe43b5 (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
27
28
29
30
31
32
33
34
35
36
var path = require('path')
var test = require('tap').test
var rimraf = require('rimraf')
var mkdirp = require('mkdirp')
var common = require('../common-tap.js')

var pkg = path.resolve(__dirname, 'spawn-enoent-help')

common.pendIfWindows('man pages are not built on Windows')

test('setup', function (t) {
  rimraf.sync(pkg)
  mkdirp.sync(pkg)
  t.end()
})

test('enoent help', function (t) {
  common.npm(['help', 'config'], {
    cwd: pkg,
    env: {
      PATH: '',
      Path: '',
      'npm_config_loglevel': 'warn',
      'npm_config_viewer': 'woman'
    }
  }, function (er, code, sout, serr) {
    t.similar(serr, /Check if the file 'emacsclient' is present./)
    t.equal(global.cooked, undefined, "Don't leak into global scope")
    t.end()
  })
})

test('clean', function (t) {
  rimraf.sync(pkg)
  t.end()
})