• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1var test = require('tap').test
2var fs = require('fs')
3var rimraf = require('rimraf')
4var mkdirp = require('mkdirp')
5var common = require('../common-tap.js')
6
7var pkg = common.pkg
8var pj = JSON.stringify({
9  name: 'x',
10  version: '1.2.3',
11  scripts: { start: 'wharble-garble-blorst' }
12}, null, 2) + '\n'
13
14test('setup', function (t) {
15  rimraf.sync(pkg)
16  mkdirp.sync(pkg)
17  fs.writeFileSync(pkg + '/package.json', pj)
18  t.end()
19})
20
21test('enoent script', function (t) {
22  common.npm(['start'], {
23    cwd: pkg,
24    env: {
25      PATH: process.env.PATH,
26      Path: process.env.Path,
27      'npm_config_loglevel': 'warn'
28    }
29  }, function (er, code, sout, serr) {
30    t.similar(serr, /npm ERR! Failed at the x@1\.2\.3 start script\./)
31    t.end()
32  })
33})
34
35test('clean', function (t) {
36  rimraf.sync(pkg)
37  t.end()
38})
39