diff options
author | Kat Marchán <kzm@zkat.tech> | 2019-04-05 15:17:30 -0400 |
---|---|---|
committer | Myles Borins <mylesborins@google.com> | 2019-04-06 20:56:17 -0400 |
commit | 033f6b566ebe9689ab1e6e3bbec5f649e6d14896 (patch) | |
tree | e1e849ac11da1dec4b910c3dfa38b4585b364d90 /deps/npm/test/tap/install-package-lock-only.js | |
parent | 58aaf58406ab52599d51d4e91249776b260487cc (diff) | |
download | android-node-v8-033f6b566ebe9689ab1e6e3bbec5f649e6d14896.tar.gz android-node-v8-033f6b566ebe9689ab1e6e3bbec5f649e6d14896.tar.bz2 android-node-v8-033f6b566ebe9689ab1e6e3bbec5f649e6d14896.zip |
deps: upgrade npm to 6.9.0
Co-authored-by: Myles Borins <mylesborins@google.com>
PR-URL: https://github.com/nodejs/node/pull/26244
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'deps/npm/test/tap/install-package-lock-only.js')
-rw-r--r-- | deps/npm/test/tap/install-package-lock-only.js | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/deps/npm/test/tap/install-package-lock-only.js b/deps/npm/test/tap/install-package-lock-only.js index 9d8aa8dbec..1610988851 100644 --- a/deps/npm/test/tap/install-package-lock-only.js +++ b/deps/npm/test/tap/install-package-lock-only.js @@ -28,6 +28,18 @@ var conf = { }) } +const confPkgLockFalse = { + cwd: testdir, + env: Object.assign({}, process.env, { + npm_config_cache: cachedir, + npm_config_tmp: tmpdir, + npm_config_prefix: globaldir, + npm_config_registry: common.registry, + npm_config_loglevel: 'warn', + npm_config_package_lock: false + }) +} + var server var fixture = new Tacks(Dir({ cache: Dir(), @@ -54,7 +66,6 @@ function cleanup () { } test('setup', function (t) { - setup() mr({port: common.port, throwOnUnmatched: true}, function (err, s) { if (err) throw err server = s @@ -63,6 +74,7 @@ test('setup', function (t) { }) test('package-lock-only', function (t) { + setup() return common.npm(['install', '--package-lock-only'], conf).spread((code, stdout, stderr) => { t.is(code, 0, 'command ran ok') t.comment(stdout.trim()) @@ -78,6 +90,32 @@ test('package-lock-only', function (t) { }) }) +test('--package-lock-only with --package-lock negates `package_lock: false`', function (t) { + setup() + return common.npm(['install', '--package-lock', '--package-lock-only'], confPkgLockFalse).spread((code, stdout, stderr) => { + t.is(code, 0, 'ok') + t.comment(stdout.trim()) + t.comment(stderr.trim()) + + // Verify that package-lock.json exists. + t.ok(fs.existsSync(pkgLockPath), 'ensure that package-lock.json was created') + t.end() + }) +}) + +test('package-lock-only creates package_lock.json when config has `package_lock: false`', function (t) { + setup() + return common.npm(['install', '--package-lock-only'], confPkgLockFalse).spread((code, stdout, stderr) => { + t.is(code, 0, 'ok') + t.comment(stdout.trim()) + t.comment(stderr.trim()) + + // Verify that package-lock.json exists. + t.ok(fs.existsSync(pkgLockPath), 'ensure that package-lock.json was created') + t.end() + }) +}) + test('cleanup', function (t) { server.close() cleanup() |