diff options
Diffstat (limited to 'deps/npm/test/tap/builtin-config.js')
-rw-r--r-- | deps/npm/test/tap/builtin-config.js | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/deps/npm/test/tap/builtin-config.js b/deps/npm/test/tap/builtin-config.js index bb08767c56..22a447c9cf 100644 --- a/deps/npm/test/tap/builtin-config.js +++ b/deps/npm/test/tap/builtin-config.js @@ -14,7 +14,7 @@ var folder = path.resolve(__dirname, 'builtin-config') var test = require('tap').test var npm = path.resolve(__dirname, '../..') var spawn = require('child_process').spawn -var node = process.execPath +var node = common.nodeBin test('setup', function (t) { t.plan(1) @@ -34,9 +34,10 @@ test('install npm into first folder', function (t) { '--prefix=' + folder + '/first', '--ignore-scripts', '--cache=' + folder + '/cache', - '--loglevel=silent', - '--tmp=' + folder + '/tmp'] - common.npm(args, {stdio: 'inherit'}, function (er, code) { + '--tmp=' + folder + '/tmp', + '--loglevel=warn', + '--progress'] + common.npm(args, {}, function (er, code) { if (er) throw er t.equal(code, 0) t.end() @@ -49,8 +50,7 @@ test('write npmrc file', function (t) { '--prefix=' + folder + '/first', '--cache=' + folder + '/cache', '--tmp=' + folder + '/tmp', - '--', - node, __filename, 'write-builtin', process.pid + '--', node, __filename, 'write-builtin', process.pid ], {'stdio': 'inherit'}, function (er, code) { @@ -73,9 +73,9 @@ test('use first npm to install second npm', function (t) { {}, function (er, code, so) { if (er) throw er - t.equal(code, 0) + t.equal(code, 0, 'got npm root') var root = so.trim() - t.ok(fs.statSync(root).isDirectory()) + t.ok(fs.statSync(root).isDirectory(), 'npm root is dir') var bin = path.resolve(root, 'npm/bin/npm-cli.js') spawn( @@ -84,14 +84,16 @@ test('use first npm to install second npm', function (t) { bin, 'install', npm, '-g', + '--ignore-scripts', '--prefix=' + folder + '/second', '--cache=' + folder + '/cache', '--tmp=' + folder + '/tmp' - ] + ], + {} ) .on('error', function (er) { throw er }) .on('close', function (code) { - t.equal(code, 0, 'code is zero') + t.equal(code, 0, 'second npm install') t.end() }) } @@ -120,9 +122,9 @@ test('verify that the builtin config matches', function (t) { var secondRoot = so.trim() var firstRc = path.resolve(firstRoot, 'npm', 'npmrc') var secondRc = path.resolve(secondRoot, 'npm', 'npmrc') - var firstData = fs.readFileSync(firstRc, 'utf8') - var secondData = fs.readFileSync(secondRc, 'utf8') - t.equal(firstData, secondData) + var firstData = fs.readFileSync(firstRc, 'utf8').split(/\r?\n/) + var secondData = fs.readFileSync(secondRc, 'utf8').split(/\r?\n/) + t.isDeeply(firstData, secondData) t.end() }) }) |