diff options
author | isaacs <nope@not.real> | 2019-07-03 10:23:19 -0700 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-07-18 15:12:49 -0700 |
commit | 1721034a40c5e7a0a334701dc36153adee3f27e5 (patch) | |
tree | 7b2ce5a0c5d67d2e1d817fc548571250e8c1a305 /deps/npm/test/network/registry.js | |
parent | 6df7b6a4f9cb64d298e7fd0691c4d09679872922 (diff) | |
download | android-node-v8-1721034a40c5e7a0a334701dc36153adee3f27e5.tar.gz android-node-v8-1721034a40c5e7a0a334701dc36153adee3f27e5.tar.bz2 android-node-v8-1721034a40c5e7a0a334701dc36153adee3f27e5.zip |
deps: upgrade npm to 6.10.0
PR-URL: https://github.com/nodejs/node/pull/28525
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Diffstat (limited to 'deps/npm/test/network/registry.js')
-rw-r--r-- | deps/npm/test/network/registry.js | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/deps/npm/test/network/registry.js b/deps/npm/test/network/registry.js index 3dbe23ffd2..d7e11c6007 100644 --- a/deps/npm/test/network/registry.js +++ b/deps/npm/test/network/registry.js @@ -2,7 +2,7 @@ // This verifies that the server-side stuff still works. var common = require('../common-tap') -var test = require('tap').test +var t = require('tap') var npmExec = require.resolve('../../bin/npm-cli.js') var path = require('path') @@ -17,16 +17,15 @@ if (v[0] === 0 && v[1] < 10) { process.versions.node ) } else { - which('couchdb', function (er) { - if (er) { - console.error('WARNING: need couch to run test: ' + er.message) - } else { - runTests() - } - }) + try { + which.sync('couchdb') + t.test(runTests) + } catch (er) { + console.error('WARNING: need couch to run test: ' + er.message) + } } -function runTests () { +function runTests (t) { var env = Object.assign({ TAP: 1 }, process.env) env.npm = npmExec // TODO: fix tap and / or nyc to handle nested invocations properly @@ -39,10 +38,8 @@ function runTests () { common.npm(['install'], opts, function (err, code) { if (err) { throw err } if (code) { - return test('need install to work', function (t) { - t.fail('install failed with: ' + code) - t.end() - }) + t.fail('install failed with: ' + code) + return t.end() } else { opts = { cwd: ca, @@ -52,10 +49,8 @@ function runTests () { common.npm(['test', '--', '-Rtap', '--no-coverage'], opts, function (err, code) { if (err) { throw err } if (code) { - return test('need test to work', function (t) { - t.fail('test failed with: ' + code) - t.end() - }) + t.fail('test failed with: ' + code) + return t.end() } opts = { cwd: ca, @@ -63,8 +58,9 @@ function runTests () { stdio: 'inherit' } common.npm(['prune', '--production'], opts, function (err, code) { - if (err) { throw err } - process.exit(code || 0) + t.ifError(err) + t.equal(code, 0) + return t.end() }) }) } |