diff --git a/.travis.yml b/.travis.yml
index 607b941c30b94..1d2e3120c4e84 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,34 +1,53 @@
sudo: true
# need to declare the language as well as the matrix below
language: node_js
+
+os:
+ - linux
+
+node_js:
+ - 12
+ - 10
+ - 8
+
+env: "DEPLOY_VERSION=testing"
+
# having top-level `env:` adds a phantom build
# https://github.com/travis-ci/travis-ci/issues/4681
#env: DEPLOY_VERSION=testing
matrix:
include:
- # LTS is our most important target
+ # Run the sudotest, but only on Linux
- node_js: "12"
# DEPLOY_VERSION is used to set the couchapp setup mode for test/tap/registry.js
# only gather coverage info for LTS
env: DEPLOY_VERSION=testing COVERALLS_REPO_TOKEN="$COVERALLS_OPTIONAL_TOKEN"
script:
# run the sudo tests, with coverage enabled
- - "sudo PATH=$PATH $(which node) . run tap -- \"test/tap/*.js\" --coverage"
- # previous LTS is next most important
+ - "sudo PATH=$PATH $(which node) . run tap -- \"test/tap/*.js\" --coverage --timeout 600"
+
+ # also run standard and license checking
- node_js: "10"
- env: DEPLOY_VERSION=testing
script:
- - "npx standard"
- - "node . run licenses"
- - "node . run tap -- \"test/tap/*.js\""
- - node_js: "8"
- env: DEPLOY_VERSION=testing
+ - "npx standard"
+ - "node . run licenses"
+
+ # separate out node 6 so we can turn off caching, because that
+ # always breaks for some reason.
- node_js: "6"
- env: DEPLOY_VERSION=testing
cache: false
+ env: "DEPLOY_VERSION=testing"
+
+ # only run one test on Windows, because it's hella slow
+ - node_js: "12"
+ os: "windows"
+ env: "DEPLOY_VERSION=testing"
+
notifications:
slack: npm-inc:kRqQjto7YbINqHPb1X6nS3g8
+
install:
- "node . install"
+
script:
- - "node . run tap -- \"test/tap/*.js\""
+ - "node . run tap -- \"test/tap/*.js\" -t600 -Rclassic -c"
diff --git a/lib/explore.js b/lib/explore.js
index 826a527fa7ef3..0c9930f8e4ca7 100644
--- a/lib/explore.js
+++ b/lib/explore.js
@@ -9,10 +9,11 @@ var npm = require('./npm.js')
var spawn = require('./utils/spawn')
var path = require('path')
var fs = require('graceful-fs')
-var isWindowsShell = require('./utils/is-windows-shell.js')
+var isWindows = require('./utils/is-windows.js')
var escapeExecPath = require('./utils/escape-exec-path.js')
var escapeArg = require('./utils/escape-arg.js')
var output = require('./utils/output.js')
+var log = require('npmlog')
function explore (args, cb) {
if (args.length < 1 || !args[0]) return cb(explore.usage)
@@ -23,7 +24,7 @@ function explore (args, cb) {
var shellArgs = []
if (args) {
- if (isWindowsShell) {
+ if (isWindows) {
var execCmd = escapeExecPath(args.shift())
var execArgs = [execCmd].concat(args.map(escapeArg))
opts.windowsVerbatimArguments = true
@@ -49,6 +50,7 @@ function explore (args, cb) {
)
}
+ log.silly('explore', {sh, shellArgs, opts})
var shell = spawn(sh, shellArgs, opts)
shell.on('close', function (er) {
// only fail if non-interactive.
diff --git a/lib/utils/escape-arg.js b/lib/utils/escape-arg.js
index d12ee5edf5820..114abaadaa090 100644
--- a/lib/utils/escape-arg.js
+++ b/lib/utils/escape-arg.js
@@ -1,6 +1,6 @@
'use strict'
var path = require('path')
-var isWindowsShell = require('./is-windows-shell.js')
+var isWindows = require('./is-windows.js')
/*
Escape the name of an executable suitable for passing to the system shell.
@@ -15,7 +15,7 @@ any single quotes in the filename.
module.exports = escapify
function escapify (str) {
- if (isWindowsShell) {
+ if (isWindows) {
return '"' + path.normalize(str) + '"'
} else {
if (/[^-_.~/\w]/.test(str)) {
diff --git a/lib/utils/escape-exec-path.js b/lib/utils/escape-exec-path.js
index bf94886efa331..42b64934867dd 100644
--- a/lib/utils/escape-exec-path.js
+++ b/lib/utils/escape-exec-path.js
@@ -1,6 +1,6 @@
'use strict'
var path = require('path')
-var isWindowsShell = require('./is-windows-shell.js')
+var isWindows = require('./is-windows.js')
/*
Escape the name of an executable suitable for passing to the system shell.
@@ -20,7 +20,7 @@ function windowsQuotes (str) {
}
function escapify (str) {
- if (isWindowsShell) {
+ if (isWindows) {
return path.normalize(str).split(/\\/).map(windowsQuotes).join('\\')
} else if (/[^-_.~/\w]/.test(str)) {
return "'" + str.replace(/'/g, "'\"'\"'") + "'"
diff --git a/node_modules/cmd-shim/index.js b/node_modules/cmd-shim/index.js
index b1b6e583f4369..010bd38d398d2 100644
--- a/node_modules/cmd-shim/index.js
+++ b/node_modules/cmd-shim/index.js
@@ -113,7 +113,7 @@ function writeShim_ (from, to, prog, args, variables, cb) {
//
// "%_prog%" "%dp0%\.\node_modules\npm\bin\npm-cli.js" %*
// @ENDLOCAL
- // @EXIT /b
+ // @EXIT /b %errorlevel%
//
// :find_dp0
// SET dp0=%~dp0
@@ -124,7 +124,7 @@ function writeShim_ (from, to, prog, args, variables, cb) {
'SETLOCAL\r\n' +
'CALL :find_dp0\r\n'
var foot = 'ENDLOCAL\r\n' +
- 'EXIT /b\r\n' +
+ 'EXIT /b %errorlevel%\r\n' +
':find_dp0\r\n' +
'SET dp0=%~dp0\r\n' +
'EXIT /b\r\n'
diff --git a/node_modules/cmd-shim/package.json b/node_modules/cmd-shim/package.json
index 7d0545e327ac8..43a7b36a8fdd0 100644
--- a/node_modules/cmd-shim/package.json
+++ b/node_modules/cmd-shim/package.json
@@ -1,28 +1,28 @@
{
- "_from": "cmd-shim@3.0.2",
- "_id": "cmd-shim@3.0.2",
+ "_from": "cmd-shim@3.0.3",
+ "_id": "cmd-shim@3.0.3",
"_inBundle": false,
- "_integrity": "sha512-x/2sXAaA1lUgUCZ9zaeOGzSkXOoN2DFxY61kgfhnIIUe/2QK8DFDnezT2drSZa/u8SKQT3vRFwTFPMMgQmH8kg==",
+ "_integrity": "sha512-DtGg+0xiFhQIntSBRzL2fRQBnmtAVwXIDo4Qq46HPpObYquxMaZS4sb82U9nH91qJrlosC1wa9gwr0QyL/HypA==",
"_location": "/cmd-shim",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
- "raw": "cmd-shim@3.0.2",
+ "raw": "cmd-shim@3.0.3",
"name": "cmd-shim",
"escapedName": "cmd-shim",
- "rawSpec": "3.0.2",
+ "rawSpec": "3.0.3",
"saveSpec": null,
- "fetchSpec": "3.0.2"
+ "fetchSpec": "3.0.3"
},
"_requiredBy": [
"#USER",
"/",
"/bin-links"
],
- "_resolved": "https://registry.npmjs.org/cmd-shim/-/cmd-shim-3.0.2.tgz",
- "_shasum": "159a20602ac4295ec0997243a40ac9b2df54f5e3",
- "_spec": "cmd-shim@3.0.2",
+ "_resolved": "https://registry.npmjs.org/cmd-shim/-/cmd-shim-3.0.3.tgz",
+ "_shasum": "2c35238d3df37d98ecdd7d5f6b8dc6b21cadc7cb",
+ "_spec": "cmd-shim@3.0.3",
"_where": "/Users/isaacs/dev/npm/cli",
"bugs": {
"url": "https://github.com/npm/cmd-shim/issues"
@@ -56,5 +56,5 @@
"snap": "TAP_SNAPSHOT=1 tap test/*.js --100",
"test": "tap test/*.js --100"
},
- "version": "3.0.2"
+ "version": "3.0.3"
}
diff --git a/node_modules/npm-package-arg/CHANGELOG.md b/node_modules/npm-package-arg/CHANGELOG.md
index 83e5763f4ffec..1b3431acced77 100644
--- a/node_modules/npm-package-arg/CHANGELOG.md
+++ b/node_modules/npm-package-arg/CHANGELOG.md
@@ -2,6 +2,16 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
+
+## [6.1.1](https://github.com/npm/npm-package-arg/compare/v6.1.0...v6.1.1) (2019-08-21)
+
+
+### Bug Fixes
+
+* preserve drive letter on windows git file:// urls ([3909203](https://github.com/npm/npm-package-arg/commit/3909203))
+
+
+
# [6.1.0](https://github.com/npm/npm-package-arg/compare/v6.0.0...v6.1.0) (2018-04-10)
diff --git a/node_modules/npm-package-arg/npa.js b/node_modules/npm-package-arg/npa.js
index 4d56237a570b9..bf2c17cfd513f 100644
--- a/node_modules/npm-package-arg/npa.js
+++ b/node_modules/npm-package-arg/npa.js
@@ -6,7 +6,11 @@ module.exports.Result = Result
let url
let HostedGit
let semver
-let path
+let path_
+function path () {
+ if (!path_) path_ = require('path')
+ return path_
+}
let validatePackageName
let osenv
@@ -109,7 +113,6 @@ function Result (opts) {
this.gitCommittish = opts.gitCommittish
this.hosted = opts.hosted
}
-Result.prototype = {}
Result.prototype.setName = function (name) {
if (!validatePackageName) validatePackageName = require('validate-npm-package-name')
@@ -152,8 +155,7 @@ const isAbsolutePath = /^[/]|^[A-Za-z]:/
function resolvePath (where, spec) {
if (isAbsolutePath.test(spec)) return spec
- if (!path) path = require('path')
- return path.resolve(where, spec)
+ return path().resolve(where, spec)
}
function isAbsolute (dir) {
@@ -180,8 +182,7 @@ function fromFile (res, where) {
if (isAbsolute(spec)) {
res.saveSpec = 'file:' + spec
} else {
- if (!path) path = require('path')
- res.saveSpec = 'file:' + path.relative(where, res.fetchSpec)
+ res.saveSpec = 'file:' + path().relative(where, res.fetchSpec)
}
}
return res
@@ -238,6 +239,11 @@ function fromURL (res) {
} else {
setGitCommittish(res, urlparse.hash != null ? urlparse.hash.slice(1) : '')
urlparse.protocol = urlparse.protocol.replace(/^git[+]/, '')
+ if (urlparse.protocol === 'file:' && /^git\+file:\/\/[a-z]:/i.test(res.rawSpec)) {
+ // keep the drive letter : on windows file paths
+ urlparse.host += ':'
+ urlparse.hostname += ':'
+ }
delete urlparse.hash
res.fetchSpec = url.format(urlparse)
}
diff --git a/node_modules/npm-package-arg/package.json b/node_modules/npm-package-arg/package.json
index 7bd5efeb43f4b..7d978a4d48a5c 100644
--- a/node_modules/npm-package-arg/package.json
+++ b/node_modules/npm-package-arg/package.json
@@ -1,41 +1,38 @@
{
- "_args": [
- [
- "npm-package-arg@6.1.0",
- "/Users/rebecca/code/npm"
- ]
- ],
- "_from": "npm-package-arg@6.1.0",
- "_id": "npm-package-arg@6.1.0",
+ "_from": "npm-package-arg@6.1.1",
+ "_id": "npm-package-arg@6.1.1",
"_inBundle": false,
- "_integrity": "sha512-zYbhP2k9DbJhA0Z3HKUePUgdB1x7MfIfKssC+WLPFMKTBZKpZh5m13PgexJjCq6KW7j17r0jHWcCpxEqnnncSA==",
+ "_integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==",
"_location": "/npm-package-arg",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
- "raw": "npm-package-arg@6.1.0",
+ "raw": "npm-package-arg@6.1.1",
"name": "npm-package-arg",
"escapedName": "npm-package-arg",
- "rawSpec": "6.1.0",
+ "rawSpec": "6.1.1",
"saveSpec": null,
- "fetchSpec": "6.1.0"
+ "fetchSpec": "6.1.1"
},
"_requiredBy": [
+ "#USER",
"/",
"/init-package-json",
"/libcipm",
- "/libnpmhook/npm-registry-fetch",
+ "/libnpm",
+ "/libnpmaccess",
+ "/libnpmpublish",
"/libnpx",
"/lock-verify",
"/npm-pick-manifest",
- "/npm-registry-client",
"/npm-registry-fetch",
"/pacote"
],
- "_resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.0.tgz",
- "_spec": "6.1.0",
- "_where": "/Users/rebecca/code/npm",
+ "_resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz",
+ "_shasum": "02168cb0a49a2b75bf988a28698de7b529df5cb7",
+ "_spec": "npm-package-arg@6.1.1",
+ "_where": "/Users/isaacs/dev/npm/cli",
"author": {
"name": "Isaac Z. Schlueter",
"email": "i@izs.me",
@@ -44,17 +41,19 @@
"bugs": {
"url": "https://github.com/npm/npm-package-arg/issues"
},
+ "bundleDependencies": false,
"dependencies": {
- "hosted-git-info": "^2.6.0",
+ "hosted-git-info": "^2.7.1",
"osenv": "^0.1.5",
- "semver": "^5.5.0",
+ "semver": "^5.6.0",
"validate-npm-package-name": "^3.0.0"
},
+ "deprecated": false,
"description": "Parse the things that can be arguments to `npm install`",
"devDependencies": {
"standard": "^11.0.1",
- "standard-version": "^4.3.0",
- "tap": "^11.1.3",
+ "standard-version": "^4.4.0",
+ "tap": "^12.5.0",
"weallbehave": "^1.2.0",
"weallcontribute": "^1.0.8"
},
@@ -77,9 +76,9 @@
"prerelease": "npm t",
"pretest": "standard",
"release": "standard-version -s",
- "test": "tap -J --coverage test/*.js",
+ "test": "tap --100 -J --coverage test/*.js",
"update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'",
"update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'"
},
- "version": "6.1.0"
+ "version": "6.1.1"
}
diff --git a/package-lock.json b/package-lock.json
index 1d149f465e3b4..ea5f763246ad3 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -786,9 +786,9 @@
}
},
"cmd-shim": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/cmd-shim/-/cmd-shim-3.0.2.tgz",
- "integrity": "sha512-x/2sXAaA1lUgUCZ9zaeOGzSkXOoN2DFxY61kgfhnIIUe/2QK8DFDnezT2drSZa/u8SKQT3vRFwTFPMMgQmH8kg==",
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/cmd-shim/-/cmd-shim-3.0.3.tgz",
+ "integrity": "sha512-DtGg+0xiFhQIntSBRzL2fRQBnmtAVwXIDo4Qq46HPpObYquxMaZS4sb82U9nH91qJrlosC1wa9gwr0QyL/HypA==",
"requires": {
"graceful-fs": "^4.1.2",
"mkdirp": "~0.5.0"
@@ -3800,13 +3800,13 @@
"integrity": "sha512-AJI/qxDB2PWI4LG1CYN579AY1vCiNyWfkiquCsJWqntRu/WwimVrC8yXeILBFHDwxfOejxewlmnvW9XXjMlYIg=="
},
"npm-package-arg": {
- "version": "6.1.0",
- "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.0.tgz",
- "integrity": "sha512-zYbhP2k9DbJhA0Z3HKUePUgdB1x7MfIfKssC+WLPFMKTBZKpZh5m13PgexJjCq6KW7j17r0jHWcCpxEqnnncSA==",
+ "version": "6.1.1",
+ "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz",
+ "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==",
"requires": {
- "hosted-git-info": "^2.6.0",
+ "hosted-git-info": "^2.7.1",
"osenv": "^0.1.5",
- "semver": "^5.5.0",
+ "semver": "^5.6.0",
"validate-npm-package-name": "^3.0.0"
}
},
diff --git a/package.json b/package.json
index 45ebd69d1d907..d8e00114979fd 100644
--- a/package.json
+++ b/package.json
@@ -48,7 +48,7 @@
"ci-info": "^2.0.0",
"cli-columns": "^3.1.2",
"cli-table3": "^0.5.1",
- "cmd-shim": "^3.0.2",
+ "cmd-shim": "^3.0.3",
"columnify": "~1.5.4",
"config-chain": "^1.1.12",
"detect-indent": "~5.0.0",
@@ -100,7 +100,7 @@
"npm-cache-filename": "~1.0.2",
"npm-install-checks": "~3.0.0",
"npm-lifecycle": "^3.1.3",
- "npm-package-arg": "^6.1.0",
+ "npm-package-arg": "^6.1.1",
"npm-packlist": "^1.4.4",
"npm-pick-manifest": "^3.0.0",
"npm-profile": "^4.0.2",
diff --git a/test/common-tap.js b/test/common-tap.js
index 44b68d719de1a..83a61f4bdbefa 100644
--- a/test/common-tap.js
+++ b/test/common-tap.js
@@ -7,6 +7,11 @@ var readCmdShim = require('read-cmd-shim')
var isWindows = require('../lib/utils/is-windows.js')
var Bluebird = require('bluebird')
+if (isWindows) {
+ var PATH = process.env.PATH ? 'PATH' : 'Path'
+ process.env[PATH] += ';C:\\Program Files\\Git\\mingw64\\libexec\\git-core'
+}
+
// remove any git envs so that we don't mess with the main repo
// when running git subprocesses in tests
Object.keys(process.env).filter(k => /^GIT/.test(k)).forEach(
@@ -103,6 +108,7 @@ ourenv.npm_config_globalconfig = exports.npm_config_globalconfig = configCommon.
ourenv.npm_config_global_style = 'false'
ourenv.npm_config_legacy_bundling = 'false'
ourenv.npm_config_fetch_retries = '0'
+ourenv.npm_config_update_notifier = 'false'
ourenv.random_env_var = 'foo'
// suppress warnings about using a prerelease version of node
ourenv.npm_config_node_version = process.version.replace(/-.*$/, '')
@@ -179,7 +185,7 @@ exports.makeGitRepo = function (params, cb) {
var added = params.added || ['package.json']
var message = params.message || 'stub repo'
- var opts = { cwd: root, env: { PATH: process.env.PATH } }
+ var opts = { cwd: root, env: { PATH: process.env.PATH || process.env.Path } }
var commands = [
git.chainableExec(['init'], opts),
git.chainableExec(['config', 'user.name', user], opts),
diff --git a/test/tap/aliases.js b/test/tap/aliases.js
index 0a0a9dfd953b1..21a68ac50f7a5 100644
--- a/test/tap/aliases.js
+++ b/test/tap/aliases.js
@@ -116,18 +116,18 @@ test('installs an npm: protocol alias package', t => {
t.comment(stdout)
t.comment(stderr)
const parsed = JSON.parse(stdout)
- t.deepEqual(parsed, {
+ t.match(parsed, {
foo: {
current: '1.2.3',
wanted: '1.2.4',
latest: '1.2.4',
- location: 'node_modules/foo'
+ location: /node_modules[/\\]foo/
},
bar: {
current: 'npm:foo@1.2.3',
wanted: 'npm:foo@1.2.4',
latest: 'npm:foo@1.2.4',
- location: 'node_modules/bar'
+ location: /node_modules[/\\]bar/
}
}, 'both regular and aliased dependency reported')
return common.npm([
diff --git a/test/tap/anon-cli-metrics.js b/test/tap/anon-cli-metrics.js
index cb1f878a4cb0a..729d9e607a4a0 100644
--- a/test/tap/anon-cli-metrics.js
+++ b/test/tap/anon-cli-metrics.js
@@ -54,7 +54,7 @@ var fixture = new Tacks(Dir({
name: 'slow',
version: '1.0.0',
scripts: {
- preinstall: "node -e 'setTimeout(function(){}, 500)'"
+ preinstall: 'node -e "setTimeout(function(){}, 500)"'
}
})
}),
diff --git a/test/tap/correct-mkdir.js b/test/tap/correct-mkdir.js
index 5c2e9771dfc08..30907d725ca08 100644
--- a/test/tap/correct-mkdir.js
+++ b/test/tap/correct-mkdir.js
@@ -1,10 +1,16 @@
/* eslint-disable camelcase */
-var test = require('tap').test
+var t = require('tap')
+var test = t.test
var assert = require('assert')
var requireInject = require('require-inject')
const common = require('../common-tap.js')
var cache_dir = common.pkg
+if (process.platform === 'win32') {
+ t.plan(0, 'windows does not use correct-mkdir behavior')
+ process.exit(0)
+}
+
test('correct-mkdir: no race conditions', function (t) {
var mock_fs = {}
var did_hook = false
diff --git a/test/tap/ignore-install-link.js b/test/tap/ignore-install-link.js
index 7b3b1be3b9d5e..a2caa23dfdb56 100644
--- a/test/tap/ignore-install-link.js
+++ b/test/tap/ignore-install-link.js
@@ -1,5 +1,5 @@
if (process.platform === 'win32') {
- console.log('ok - symlinks are weird on windows, skip this test')
+ require('tap').plan(0, 'symlinks are weird on windows, skip this test')
process.exit(0)
}
var common = require('../common-tap.js')
diff --git a/test/tap/install-link-scripts.js b/test/tap/install-link-scripts.js
index bff4dd5ef0106..3553e6377370a 100644
--- a/test/tap/install-link-scripts.js
+++ b/test/tap/install-link-scripts.js
@@ -1,3 +1,7 @@
+if (process.platform === 'win32') {
+ require('tap').plan(0, 'links are weird on windows, skip this')
+ process.exit(0)
+}
var fs = require('graceful-fs')
var path = require('path')
diff --git a/test/tap/lifecycle-INIT_CWD.js b/test/tap/lifecycle-INIT_CWD.js
index e035cf86d4033..3e9c1c8257f46 100644
--- a/test/tap/lifecycle-INIT_CWD.js
+++ b/test/tap/lifecycle-INIT_CWD.js
@@ -15,7 +15,7 @@ var json = {
name: 'init-cwd',
version: '1.0.0',
scripts: {
- initcwd: 'echo "$INIT_CWD"'
+ initcwd: process.platform === 'win32' ? 'echo %INIT_CWD%' : 'echo "$INIT_CWD"'
}
}
diff --git a/test/tap/ls-l-depth-0.js b/test/tap/ls-l-depth-0.js
index 8459bd52032cb..b2516c9fa2449 100644
--- a/test/tap/ls-l-depth-0.js
+++ b/test/tap/ls-l-depth-0.js
@@ -67,10 +67,12 @@ test('#6311: npm ll --depth=0 duplicates listing', function (t) {
if (err) throw err
t.notOk(code, 'npm install exited cleanly')
t.is(stderr, '', 'npm install ran silently')
- t.equal(
+ t.match(
stdout.trim(),
- 'add\tunderscore\t1.5.1\tnode_modules/underscore\t\t\n' +
- 'add\tglock\t1.8.7\tnode_modules/glock',
+ new RegExp(
+ '^add\tunderscore\t1[.]5[.]1\tnode_modules[\\\\/]underscore\t\t[\n]' +
+ 'add\tglock\t1[.]8[.]7\tnode_modules[\\\\/]glock$'
+ ),
'got expected install output'
)
diff --git a/test/tap/outdated-long.js b/test/tap/outdated-long.js
index 0a338815983eb..8cd2ceadb96fc 100644
--- a/test/tap/outdated-long.js
+++ b/test/tap/outdated-long.js
@@ -79,6 +79,7 @@ test('it should not throw', function (t) {
t.is(process.exitCode, 1, 'exit code set to 1')
process.exitCode = 0
console.log = originalLog
+ output[0] = output[0].replace(/\\/g, '/')
t.same(output, expOut)
t.same(d, expData)
diff --git a/test/tap/prepublish-only.js b/test/tap/prepublish-only.js
index 57af26038a7bd..56881494d2381 100644
--- a/test/tap/prepublish-only.js
+++ b/test/tap/prepublish-only.js
@@ -17,7 +17,6 @@ var tmpdir = join(pkg, 'tmp')
var env = {
'npm_config_cache': cachedir,
'npm_config_tmp': tmpdir,
- 'npm_config_prefix': pkg,
'npm_config_global': 'false'
}
@@ -64,7 +63,6 @@ var fixture = new Tacks(Dir({
}))
test('setup', function (t) {
- cleanup()
fixture.create(pkg)
mr({port: common.port, throwOnUnmatched: true}, function (err, s) {
t.ifError(err, 'registry mocked successfully')
@@ -131,12 +129,7 @@ test('test', function (t) {
})
test('cleanup', function (t) {
- cleanup()
server.close()
t.pass('cleaned up')
t.end()
})
-
-function cleanup () {
- fixture.remove(pkg)
-}
diff --git a/test/tap/prune.js b/test/tap/prune.js
index 936ee3a91b6b8..ce2a300b1a537 100644
--- a/test/tap/prune.js
+++ b/test/tap/prune.js
@@ -104,7 +104,7 @@ test('production: npm prune', function (t) {
], EXEC_OPTS, function (err, code, stdout) {
if (err) throw err
t.notOk(code, 'exit ok')
- t.equal(stdout.trim(), 'remove\tmkdirp\t0.3.5\tnode_modules/mkdirp')
+ t.equal(stdout.trim().replace(/\\/g, '/'), 'remove\tmkdirp\t0.3.5\tnode_modules/mkdirp')
t.end()
})
})
diff --git a/test/tap/shared-linked.js b/test/tap/shared-linked.js
index cbdbcf66c1612..517be4699d973 100644
--- a/test/tap/shared-linked.js
+++ b/test/tap/shared-linked.js
@@ -133,7 +133,7 @@ test('shared-linked', function (t) {
common.npm(config.concat(['install', '--dry-run', '--parseable']), options, function (err, code, stdout, stderr) {
if (err) throw err
t.is(code, 0)
- var got = stdout.trim().replace(/\s+\n/g, '\n')
+ var got = stdout.trim().replace(/\s+\n/g, '\n').replace(/\\/g, '/')
var expected =
'add\tminimist\t0.0.5\tnode_modules/minimist\n' +
'add\twordwrap\t0.0.2\tnode_modules/wordwrap\n' +
diff --git a/test/tap/shrinkwrap-lifecycle-cwd.js b/test/tap/shrinkwrap-lifecycle-cwd.js
index f8927df5a2969..78f40f5297628 100644
--- a/test/tap/shrinkwrap-lifecycle-cwd.js
+++ b/test/tap/shrinkwrap-lifecycle-cwd.js
@@ -12,7 +12,6 @@ var testdir = path.join(basedir, 'testdir')
var cachedir = common.cache
var globaldir = path.join(basedir, 'global')
var tmpdir = path.join(basedir, 'tmp')
-var escapeArg = require('../../lib/utils/escape-arg.js')
var conf = {
cwd: testdir,
@@ -39,8 +38,8 @@ var fixture = new Tacks(Dir({
// add this to the end of the command to preserve the debug log:
// || mv npm-debug.log real-debug.log
// removed for windows compat reasons
- abc: escapeArg(common.nodeBin) + ' ' + escapeArg(common.bin) + ' shrinkwrap',
- shrinkwrap: escapeArg(common.nodeBin) + ' scripts/shrinkwrap.js'
+ abc: 'node ' + JSON.stringify(common.bin) + ' shrinkwrap',
+ shrinkwrap: 'node scripts/shrinkwrap.js'
}
}),
scripts: Dir({
diff --git a/test/tap/shrinkwrap-save-with-existing-dev-deps.js b/test/tap/shrinkwrap-save-with-existing-dev-deps.js
index fcbbeeffddf4d..8a3f449fa8865 100644
--- a/test/tap/shrinkwrap-save-with-existing-dev-deps.js
+++ b/test/tap/shrinkwrap-save-with-existing-dev-deps.js
@@ -18,7 +18,13 @@ var example_pkg = path.join(example, 'package.json')
var installed = path.join(example, 'node_modules', 'installed')
var installed_pkg = path.join(installed, 'package.json')
-var EXEC_OPTS = { cwd: example }
+// Ignore max listeners warnings until that gets fixed
+var env = Object.keys(process.env).reduce((set, key) => {
+ if (!set[key]) set[key] = process.env[key]
+ return set
+}, { NODE_NO_WARNINGS: '1' })
+
+var EXEC_OPTS = { cwd: example, env: env }
var installme_pkg_json = {
name: 'installme',
diff --git a/test/tap/whoami.js b/test/tap/whoami.js
index 4e4b3da282ade..9f4bf4266b74c 100644
--- a/test/tap/whoami.js
+++ b/test/tap/whoami.js
@@ -36,7 +36,7 @@ test('npm whoami with basic auth', function (t) {
)
})
-test('npm whoami with bearer auth', { timeout: 2 * 1000 }, function (t) {
+test('npm whoami with bearer auth', { timeout: 6000 }, function (t) {
var s = '//localhost:' + common.port +
'/:_authToken = wombat-developers-union\n'
fs.writeFileSync(FIXTURE_PATH, s, 'ascii')