]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/run-script-filter-private.js
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / test / tap / run-script-filter-private.js
1 var fs = require('graceful-fs')
2 var path = require('path')
3
4 var mkdirp = require('mkdirp')
5 var rimraf = require('rimraf')
6 var test = require('tap').test
7
8 var common = require('../common-tap')
9
10 var pkg = path.resolve(__dirname, 'run-script-filter-private')
11
12 var opts = { cwd: pkg }
13
14 var json = {
15   name: 'run-script-filter-private',
16   version: '1.2.3'
17 }
18
19 var npmrc = '//blah.com:_harsh=realms\n'
20
21 test('setup', function (t) {
22   cleanup()
23   mkdirp.sync(pkg)
24   fs.writeFileSync(
25     path.resolve(pkg, 'package.json'),
26     JSON.stringify(json, null, 2) + '\n'
27   )
28   fs.writeFileSync(
29     path.resolve(pkg, '.npmrc'),
30     npmrc
31   )
32   t.end()
33 })
34
35 test('npm run-script env', function (t) {
36   common.npm(['run-script', 'env'], opts, function (er, code, stdout, stderr) {
37     t.ifError(er, 'using default env script')
38     t.notOk(stderr, 'should not generate errors')
39     t.ok(stdout.indexOf('npm_config_init_version') > 0, 'expected values in var list')
40     t.notMatch(stdout, /harsh/, 'unexpected config not there')
41     t.end()
42   })
43 })
44
45 test('cleanup', function (t) {
46   cleanup()
47   t.end()
48 })
49
50 function cleanup () {
51   rimraf.sync(pkg)
52 }