aboutsummaryrefslogtreecommitdiff
path: root/deps/npm/test/common-tap.js
diff options
context:
space:
mode:
authorKat Marchán <kzm@sykosomatic.org>2016-05-27 14:07:59 -0700
committerJeremiah Senkpiel <fishrock123@rocketmail.com>2016-05-28 10:42:48 -0400
commitbd8b1ddb2007dcc8ec2a0a08e16208aa21b83400 (patch)
treeaab54a7bbc42e1477a8a2b175dfc9f9eb36ca9e2 /deps/npm/test/common-tap.js
parent16f98e589c69ffe6283aa11493fd417368708557 (diff)
downloadandroid-node-v8-bd8b1ddb2007dcc8ec2a0a08e16208aa21b83400.tar.gz
android-node-v8-bd8b1ddb2007dcc8ec2a0a08e16208aa21b83400.tar.bz2
android-node-v8-bd8b1ddb2007dcc8ec2a0a08e16208aa21b83400.zip
deps: upgrade npm to 3.9.3
Contains the following npm releases: - v3.9.0: https://github.com/npm/npm/releases/tag/v3.9.0 - v3.9.1: https://github.com/npm/npm/releases/tag/v3.9.1 - v3.9.2: https://github.com/npm/npm/releases/tag/v3.9.2 - v3.9.3: https://github.com/npm/npm/releases/tag/v3.9.3 PR-URL: https://github.com/nodejs/node/pull/7030 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Diffstat (limited to 'deps/npm/test/common-tap.js')
-rw-r--r--deps/npm/test/common-tap.js35
1 files changed, 33 insertions, 2 deletions
diff --git a/deps/npm/test/common-tap.js b/deps/npm/test/common-tap.js
index d7e9c8f7d0..847c87ba0f 100644
--- a/deps/npm/test/common-tap.js
+++ b/deps/npm/test/common-tap.js
@@ -1,3 +1,8 @@
+'use strict'
+var fs = require('graceful-fs')
+var readCmdShim = require('read-cmd-shim')
+var isWindows = require('../lib/utils/is-windows.js')
+
// cheesy hackaround for test deps (read: nock) that rely on setImmediate
if (!global.setImmediate || !require('timers').setImmediate) {
require('timers').setImmediate = global.setImmediate = function () {
@@ -25,9 +30,12 @@ process.env.random_env_var = 'foo'
process.env.npm_config_node_version = process.version.replace(/-.*$/, '')
var bin = exports.bin = require.resolve('../bin/npm-cli.js')
+
var chain = require('slide').chain
var once = require('once')
+var nodeBin = exports.nodeBin = process.env.npm_node_execpath || process.env.NODE || process.execPath
+
exports.npm = function (cmd, opts, cb) {
cb = once(cb)
cmd = [bin].concat(cmd)
@@ -40,8 +48,7 @@ exports.npm = function (cmd, opts, cb) {
var stdout = ''
var stderr = ''
- var node = process.execPath
- var child = spawn(node, cmd, opts)
+ var child = spawn(nodeBin, cmd, opts)
if (child.stderr) {
child.stderr.on('data', function (chunk) {
@@ -88,3 +95,27 @@ exports.makeGitRepo = function (params, cb) {
chain(commands, cb)
}
+
+exports.readBinLink = function (path) {
+ if (isWindows) {
+ return readCmdShim.sync(path)
+ } else {
+ return fs.readlinkSync(path)
+ }
+}
+
+exports.skipIfWindows = function (why) {
+ if (!isWindows) return
+ console.log('1..1')
+ if (!why) why = 'this test not available on windows'
+ console.log('ok 1 # skip ' + why)
+ process.exit(0)
+}
+
+exports.pendIfWindows = function (why) {
+ if (!isWindows) return
+ console.log('1..1')
+ if (!why) why = 'this test is pending further changes on windows'
+ console.log('not ok 1 # todo ' + why)
+ process.exit(0)
+}