diff options
author | Ruy Adorno <ruyadorno@hotmail.com> | 2020-08-17 17:58:47 -0400 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2020-09-22 19:55:58 +0200 |
commit | f87b6c0f7ce9a4d98414ee668a6ac216c817c2d9 (patch) | |
tree | 3fc16b7b1f8c04aaa86b1ab8a37890cf6f146341 /deps/npm/test | |
parent | d016cdcaa9310840bb618cb16c4237286f98be80 (diff) | |
download | node-new-f87b6c0f7ce9a4d98414ee668a6ac216c817c2d9.tar.gz |
deps: upgrade npm to 6.14.8
PR-URL: https://github.com/nodejs/node/pull/34834
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Diffstat (limited to 'deps/npm/test')
-rw-r--r-- | deps/npm/test/fixtures/config/userconfig-with-gc | 2 | ||||
-rw-r--r-- | deps/npm/test/tap/publish-invalid-semver-tag.js | 2 | ||||
-rw-r--r-- | deps/npm/test/tap/referer.js | 60 | ||||
-rw-r--r-- | deps/npm/test/tap/semver-doc.js | 4 | ||||
-rw-r--r-- | deps/npm/test/tap/whoami.js | 2 |
5 files changed, 66 insertions, 4 deletions
diff --git a/deps/npm/test/fixtures/config/userconfig-with-gc b/deps/npm/test/fixtures/config/userconfig-with-gc index b00d5195bd..e2237dffc7 100644 --- a/deps/npm/test/fixtures/config/userconfig-with-gc +++ b/deps/npm/test/fixtures/config/userconfig-with-gc @@ -1,4 +1,4 @@ -globalconfig = /Users/claudiahdz/npm/cli/test/fixtures/config/globalconfig +globalconfig = /Users/ruyadorno/Documents/workspace/cli/latest/test/fixtures/config/globalconfig email = i@izs.me env-thing = ${random_env_var} init.author.name = Isaac Z. Schlueter diff --git a/deps/npm/test/tap/publish-invalid-semver-tag.js b/deps/npm/test/tap/publish-invalid-semver-tag.js index b5d499f377..9c2f40813b 100644 --- a/deps/npm/test/tap/publish-invalid-semver-tag.js +++ b/deps/npm/test/tap/publish-invalid-semver-tag.js @@ -28,7 +28,7 @@ function resetPackage (options) { chownSync(CACHE_DIR, sudoUID, sudoGID) } - fs.writeFileSync(path.resolve(PKG_DIR, 'package.json'), DEFAULT_PKG) + fs.writeFileSync(path.resolve(PKG_DIR, 'package.json'), JSON.stringify(DEFAULT_PKG)) } test('setup', function (t) { diff --git a/deps/npm/test/tap/referer.js b/deps/npm/test/tap/referer.js index 8c3dbed72c..6df676db62 100644 --- a/deps/npm/test/tap/referer.js +++ b/deps/npm/test/tap/referer.js @@ -21,3 +21,63 @@ test('should send referer http header', function (t) { }) }) }) + +test('should redact user secret from hook add command', function (t) { + http.createServer(function (q, s) { + t.equal(q.headers.referer, 'hook add ~zkat [REDACTED] [REDACTED]') + s.statusCode = 204 + s.end() + this.close() + }).listen(common.port, function () { + var reg = `http://localhost:${common.port}` + var args = [ 'hook', 'add', '~zkat', 'https://example.com', 'sekrit', '--registry', reg ] + common.npm(args, {}, function (er, code) { + if (er) { + throw er + } + // should not have ended nicely, since we returned an error + t.ok(code) + t.end() + }) + }) +}) + +test('should redact user secret from hook up command', function (t) { + http.createServer(function (q, s) { + t.equal(q.headers.referer, 'hook up ~zkat [REDACTED] [REDACTED]') + s.statusCode = 204 + s.end() + this.close() + }).listen(common.port, function () { + var reg = `http://localhost:${common.port}` + var args = [ 'hook', 'up', '~zkat', 'https://example.com', 'sekrit', '--registry', reg ] + common.npm(args, {}, function (er, code) { + if (er) { + throw er + } + // should not have ended nicely, since we returned an error + t.ok(code) + t.end() + }) + }) +}) + +test('should redact user secret from hook update command', function (t) { + http.createServer(function (q, s) { + t.equal(q.headers.referer, 'hook update ~zkat [REDACTED] [REDACTED]') + s.statusCode = 204 + s.end() + this.close() + }).listen(common.port, function () { + var reg = `http://localhost:${common.port}` + var args = [ 'hook', 'update', '~zkat', 'https://example.com', 'sekrit', '--registry', reg ] + common.npm(args, {}, function (er, code) { + if (er) { + throw er + } + // should not have ended nicely, since we returned an error + t.ok(code) + t.end() + }) + }) +}) diff --git a/deps/npm/test/tap/semver-doc.js b/deps/npm/test/tap/semver-doc.js index 1cc978201c..fe2077660c 100644 --- a/deps/npm/test/tap/semver-doc.js +++ b/deps/npm/test/tap/semver-doc.js @@ -5,8 +5,10 @@ test('semver doc is up to date', function (t) { var moddoc = path.join(__dirname, '../../node_modules/semver/README.md') var mydoc = path.join(__dirname, '../../docs/content/using-npm/semver.md') var fs = require('fs') - var mod = fs.readFileSync(moddoc, 'utf8').replace(/semver\(1\)/, 'semver(7)') + var mod = fs.readFileSync(moddoc, 'utf8') + mod = mod.substr(mod.match(/^## Install$/m).index) var my = fs.readFileSync(mydoc, 'utf8') + my = my.substr(my.match(/^## Install$/m).index) t.equal(my, mod) t.end() }) diff --git a/deps/npm/test/tap/whoami.js b/deps/npm/test/tap/whoami.js index 9f4bf4266b..aabf5b2821 100644 --- a/deps/npm/test/tap/whoami.js +++ b/deps/npm/test/tap/whoami.js @@ -36,7 +36,7 @@ test('npm whoami with basic auth', function (t) { ) }) -test('npm whoami with bearer auth', { timeout: 6000 }, function (t) { +test('npm whoami with bearer auth', { timeout: 8000 }, function (t) { var s = '//localhost:' + common.port + '/:_authToken = wombat-developers-union\n' fs.writeFileSync(FIXTURE_PATH, s, 'ascii') |