Commit 97f53cc9 authored by Ross Gammon's avatar Ross Gammon

Merge tag 'upstream/2.2.5'

Upstream version 2.2.5

# gpg: Signature made Sat 12 Nov 2016 04:47:54 PM CET
# gpg:                using RSA key 0x733E6BF93CE8F6D9
# gpg: Good signature from "Ross Gammon (Rosco) <rossgammon@mail.dk>"
# gpg:                 aka "Ross Gammon (Genealogy) <genealogy@the-gammons.net>"
# gpg:                 aka "Ross Gammon (www.one-name.org) <gammon@one-name.org>"
# gpg:                 aka "Ross Gammon (www.the-gammons.net) <ross@the-gammons.net>"
# gpg:                 aka "[jpeg image of size 3524]"
# gpg:                 aka "Ross Gammon (http://www.ubuntu.com/) <rosco2@ubuntu.com>"
# gpg:                 aka "Ross Gammon (http://ubuntustudio.org/) <rosco@ubuntustudio.org>"
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: FBEE 0190 904F 1EA0 BA6A  300E 53FE 7BBD A689 10FC
#      Subkey fingerprint: 7AEE BC7A 44AB 8B90 5CA7  8FC6 733E 6BF9 3CE8 F6D9
parents 0ccd1db4 ed4b5d28
{
"root": true,
"extends": [
"@satazor/eslint-config/es5",
"@satazor/eslint-config/addons/node"
]
}
\ No newline at end of file
{
"predef": [
"console",
"describe",
"it",
"after",
"afterEach",
"before",
"beforeEach"
],
"indent": 4,
"node": true,
"devel": true,
"bitwise": false,
"curly": false,
"eqeqeq": true,
"forin": false,
"immed": true,
"latedef": false,
"newcap": true,
"noarg": true,
"noempty": false,
"nonew": true,
"plusplus": false,
"regexp": false,
"undef": true,
"unused": "vars",
"quotmark": "single",
"strict": false,
"trailing": true,
"camelcase": true,
"asi": false,
"boss": true,
"debug": false,
"eqnull": true,
"es5": false,
"esnext": false,
"evil": false,
"expr": true,
"funcscope": false,
"globalstrict": false,
"iterator": false,
"lastsemic": false,
"laxbreak": true,
"laxcomma": false,
"loopfunc": true,
"multistr": false,
"onecase": true,
"regexdash": false,
"scripturl": false,
"smarttabs": false,
"shadow": false,
"sub": false,
"supernew": true,
"validthis": false,
"nomen": false,
"white": true
}
...@@ -2,7 +2,6 @@ language: node_js ...@@ -2,7 +2,6 @@ language: node_js
node_js: node_js:
- '0.10' - '0.10'
- '0.12' - '0.12'
- 'iojs-1'
- 'iojs-2'
- 'iojs-3'
- '4' - '4'
- '5'
- '6'
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
[downloads-image]:http://img.shields.io/npm/dm/cross-spawn-async.svg [downloads-image]:http://img.shields.io/npm/dm/cross-spawn-async.svg
[npm-image]:http://img.shields.io/npm/v/cross-spawn-async.svg [npm-image]:http://img.shields.io/npm/v/cross-spawn-async.svg
[travis-url]:https://travis-ci.org/IndigoUnited/node-cross-spawn-async [travis-url]:https://travis-ci.org/IndigoUnited/node-cross-spawn-async
[travis-image]:http://img.shields.io/travis/IndigoUnited/node-cross-spawn-async.svg [travis-image]:http://img.shields.io/travis/IndigoUnited/node-cross-spawn-async/master.svg
[appveyor-url]:https://ci.appveyor.com/project/satazor/node-cross-spawn-async [appveyor-url]:https://ci.appveyor.com/project/satazor/node-cross-spawn-async
[appveyor-image]:https://img.shields.io/appveyor/ci/satazor/node-cross-spawn-async.svg [appveyor-image]:https://img.shields.io/appveyor/ci/satazor/node-cross-spawn-async/master.svg
[david-dm-url]:https://david-dm.org/IndigoUnited/node-cross-spawn-async [david-dm-url]:https://david-dm.org/IndigoUnited/node-cross-spawn-async
[david-dm-image]:https://img.shields.io/david/IndigoUnited/node-cross-spawn-async.svg [david-dm-image]:https://img.shields.io/david/IndigoUnited/node-cross-spawn-async.svg
[david-dm-dev-url]:https://david-dm.org/IndigoUnited/node-cross-spawn-async#info=devDependencies [david-dm-dev-url]:https://david-dm.org/IndigoUnited/node-cross-spawn-async#info=devDependencies
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
A cross platform solution to node's spawn. A cross platform solution to node's spawn.
**This module is deprecated, use [cross-spawn](https://github.com/IndigoUnited/node-cross-spawn) instead which no longer requires a build toolchain.**
## Installation ## Installation
...@@ -42,7 +44,7 @@ Exactly the same way as node's [`spawn`](https://nodejs.org/api/child_process.ht ...@@ -42,7 +44,7 @@ Exactly the same way as node's [`spawn`](https://nodejs.org/api/child_process.ht
```javascript ```javascript
var spawn = require('cross-spawn-async'); var spawn = require('cross-spawn-async');
var process = spawn('npm', ['list', '-g', '-depth', '0'], { stdio: 'inherit' }); var child = spawn('npm', ['list', '-g', '-depth', '0'], { stdio: 'inherit' });
``` ```
......
...@@ -13,10 +13,9 @@ environment: ...@@ -13,10 +13,9 @@ environment:
matrix: matrix:
- nodejs_version: 0.10 - nodejs_version: 0.10
- nodejs_version: 0.12 - nodejs_version: 0.12
- nodejs_version: 1
- nodejs_version: 2
- nodejs_version: 3
- nodejs_version: 4 - nodejs_version: 4
- nodejs_version: 5
- nodejs_version: 6
# get the latest stable version of Node 0.STABLE.latest # get the latest stable version of Node 0.STABLE.latest
install: install:
......
var cp = require('child_process'); 'use strict';
var parse = require('./lib/parse');
var cp = require('child_process');
var parse = require('./lib/parse');
var enoent = require('./lib/enoent'); var enoent = require('./lib/enoent');
function spawn(command, args, options) { function spawn(command, args, options) {
...@@ -19,7 +21,7 @@ function spawn(command, args, options) { ...@@ -19,7 +21,7 @@ function spawn(command, args, options) {
return spawned; return spawned;
} }
module.exports = spawn; module.exports = spawn;
module.exports.spawn = spawn; module.exports.spawn = spawn;
module.exports._parse = parse; module.exports._parse = parse;
module.exports._enoent = enoent; module.exports._enoent = enoent;
...@@ -47,5 +47,5 @@ function verifyENOENT(status, parsed, syscall) { ...@@ -47,5 +47,5 @@ function verifyENOENT(status, parsed, syscall) {
} }
module.exports.hookChildProcess = hookChildProcess; module.exports.hookChildProcess = hookChildProcess;
module.exports.verifyENOENT = verifyENOENT; module.exports.verifyENOENT = verifyENOENT;
module.exports.notFoundError = notFoundError; module.exports.notFoundError = notFoundError;
var fs = require('fs'); 'use strict';
var LRU = require('lru-cache');
var fs = require('fs');
var LRU = require('lru-cache');
var resolveCommand = require('./resolveCommand'); var resolveCommand = require('./resolveCommand');
var mixIn = require('./util/mixIn');
var isWin = process.platform === 'win32'; var isWin = process.platform === 'win32';
var shebangCache = LRU({ max: 50, maxAge: 30 * 1000 }); // Cache just for 30sec var shebangCache = new LRU({ max: 50, maxAge: 30 * 1000 }); // Cache just for 30sec
function readShebang(command) { function readShebang(command) {
var buffer; var buffer;
...@@ -24,10 +25,10 @@ function readShebang(command) { ...@@ -24,10 +25,10 @@ function readShebang(command) {
fd = fs.openSync(command, 'r'); fd = fs.openSync(command, 'r');
fs.readSync(fd, buffer, 0, 150, 0); fs.readSync(fd, buffer, 0, 150, 0);
fs.closeSync(fd); fs.closeSync(fd);
} catch (e) {} } catch (e) { /* empty */ }
// Check if it is a shebang // Check if it is a shebang
match = buffer.toString().trim().match(/\#\!(.+)/i); match = buffer.toString().trim().match(/#!(.+)/i);
if (match) { if (match) {
shebang = match[1].replace(/\/usr\/bin\/env\s+/i, ''); // Remove /usr/bin/env shebang = match[1].replace(/\/usr\/bin\/env\s+/i, ''); // Remove /usr/bin/env
...@@ -46,11 +47,11 @@ function escapeArg(arg, quote) { ...@@ -46,11 +47,11 @@ function escapeArg(arg, quote) {
// If we are not going to quote the argument, // If we are not going to quote the argument,
// escape shell metacharacters, including double and single quotes: // escape shell metacharacters, including double and single quotes:
if (!quote) { if (!quote) {
arg = arg.replace(/([\(\)%!\^<>&|;,"' ])/g, '^$1'); arg = arg.replace(/([\(\)%!\^<>&|;,"'\s])/g, '^$1');
} else { } else {
// Sequence of backslashes followed by a double quote: // Sequence of backslashes followed by a double quote:
// double up all the backslashes and escape the double quote // double up all the backslashes and escape the double quote
arg = arg.replace(/(\\*)"/gi, '$1$1\\"'); arg = arg.replace(/(\\*)"/g, '$1$1\\"');
// Sequence of backslashes followed by the end of the string // Sequence of backslashes followed by the end of the string
// (which will become a double quote later): // (which will become a double quote later):
...@@ -69,11 +70,11 @@ function escapeArg(arg, quote) { ...@@ -69,11 +70,11 @@ function escapeArg(arg, quote) {
function escapeCommand(command) { function escapeCommand(command) {
// Do not escape if this command is not dangerous.. // Do not escape if this command is not dangerous..
// We do this so that commands like "echo" or "ifconfig" work // We do this so that commands like "echo" or "ifconfig" work
// Quoting them, will make them unnaccessible // Quoting them, will make them unaccessible
return /^[a-z0-9_-]+$/i.test(command) ? command : escapeArg(command, true); return /^[a-z0-9_-]+$/i.test(command) ? command : escapeArg(command, true);
} }
function parseCall(command, args, options) { function parse(command, args, options) {
var shebang; var shebang;
var applyQuotes; var applyQuotes;
var file; var file;
...@@ -86,7 +87,7 @@ function parseCall(command, args, options) { ...@@ -86,7 +87,7 @@ function parseCall(command, args, options) {
} }
args = args ? args.slice(0) : []; // Clone array to avoid changing the original args = args ? args.slice(0) : []; // Clone array to avoid changing the original
options = mixIn({}, options); options = options || {};
original = command; original = command;
if (isWin) { if (isWin) {
...@@ -120,8 +121,8 @@ function parseCall(command, args, options) { ...@@ -120,8 +121,8 @@ function parseCall(command, args, options) {
args: args, args: args,
options: options, options: options,
file: file, file: file,
original: original original: original,
}; };
} }
module.exports = parseCall; module.exports = parse;
'use strict'; 'use strict';
var path = require('path'); var path = require('path');
var which = require('which'); var which = require('which');
var LRU = require('lru-cache'); var LRU = require('lru-cache');
var resolveCache = LRU({ max: 50, maxAge: 30 * 1000 }); // Cache just for 30sec var commandCache = new LRU({ max: 50, maxAge: 30 * 1000 }); // Cache just for 30sec
var hasSepInPathRegExp = new RegExp(process.platform === 'win32' ? /[\/\\]/ : /\//);
function resolveCommand(command, noExtension) { function resolveCommand(command, noExtension) {
var resolved; var resolved;
// If command looks like a file path, make it absolute to make it canonical
// and also to circuvent a bug in which, see: https://github.com/npm/node-which/issues/33
if (hasSepInPathRegExp.test(command)) {
command = path.resolve(command);
}
noExtension = !!noExtension; noExtension = !!noExtension;
resolved = resolveCache.get(command + '!' + noExtension); resolved = commandCache.get(command + '!' + noExtension);
// Check if its resolved in the cache // Check if its resolved in the cache
if (resolveCache.has(command)) { if (commandCache.has(command)) {
return resolveCache.get(command); return commandCache.get(command);
} }
try { try {
resolved = !noExtension ? resolved = !noExtension ?
which.sync(command) : which.sync(command) :
which.sync(command, { pathExt: path.delimiter + (process.env.PATHEXT || '') }); which.sync(command, { pathExt: path.delimiter + (process.env.PATHEXT || '') });
} catch (e) {} } catch (e) { /* empty */ }
resolveCache.set(command + '!' + noExtension, resolved); commandCache.set(command + '!' + noExtension, resolved);
return resolved; return resolved;
} }
......
'use strict';
function mixIn(target, source) {
var key;
// No need to check for hasOwnProperty.. this is used
// just in plain objects
for (key in source) {
target[key] = source[key];
}
return target;
}
module.exports = mixIn;
{ {
"name": "cross-spawn-async", "name": "cross-spawn-async",
"version": "2.1.9", "version": "2.2.5",
"description": "Cross platform child_process#spawn", "description": "Cross platform child_process#spawn",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "node test/prepare && mocha --bail test/test" "test": "node test/prepare && mocha --bail test/test",
"lint": "eslint '{*.js,lib/**/*.js,test/**/*.js}'"
}, },
"bugs": { "bugs": {
"url": "https://github.com/IndigoUnited/node-cross-spawn-async/issues/" "url": "https://github.com/IndigoUnited/node-cross-spawn-async/issues/"
...@@ -31,13 +32,15 @@ ...@@ -31,13 +32,15 @@
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"lru-cache": "^4.0.0", "lru-cache": "^4.0.0",
"which": "^1.2.4" "which": "^1.2.8"
}, },
"devDependencies": { "devDependencies": {
"@satazor/eslint-config": "^3.0.0",
"eslint": "^3.0.0",
"expect.js": "^0.3.0", "expect.js": "^0.3.0",
"glob": "^7.0.0", "glob": "^7.0.0",
"mkdirp": "^0.5.1", "mkdirp": "^0.5.1",
"mocha": "^2.2.5", "mocha": "^3.0.2",
"rimraf": "^2.5.0" "rimraf": "^2.5.0"
} }
} }
{
"env": {
"mocha": true
},
"rules": {
"no-invalid-this": 0
}
}
\ No newline at end of file
'use strict';
var args = process.argv.slice(2); var args = process.argv.slice(2);
args.forEach(function (arg, index) { args.forEach(function (arg, index) {
......
'use strict';
process.exit(25); process.exit(25);
#!/usr/bin/env node #!/usr/bin/env node
'use strict';
process.stdout.write('shebang works!'); process.stdout.write('shebang works!');
'use strict';
var glob = require('glob'); var glob = require('glob');
var fs = require('fs'); var fs = require('fs');
var fixturesDir = __dirname + '/fixtures'; var fixturesDir = __dirname + '/fixtures';
...@@ -8,7 +10,7 @@ glob.sync('prepare_*', { cwd: __dirname + '/fixtures' }).forEach(function (file) ...@@ -8,7 +10,7 @@ glob.sync('prepare_*', { cwd: __dirname + '/fixtures' }).forEach(function (file)
var finalFile = file.replace(/^prepare_/, '').replace(/\.sh$/, ''); var finalFile = file.replace(/^prepare_/, '').replace(/\.sh$/, '');
fs.writeFileSync(fixturesDir + '/' + finalFile, contents); fs.writeFileSync(fixturesDir + '/' + finalFile, contents);
fs.chmodSync(fixturesDir + '/' + finalFile, 0777); fs.chmodSync(fixturesDir + '/' + finalFile, parseInt('0777', 8));
process.stdout.write('Copied "' + file + '" to "' + finalFile + '"\n'); process.stdout.write('Copied "' + file + '" to "' + finalFile + '"\n');
}); });
'use strict'; 'use strict';
var path = require('path'); var path = require('path');
var fs = require('fs'); var fs = require('fs');
var which = require('which'); var which = require('which');
var rimraf = require('rimraf'); var rimraf = require('rimraf');
var mkdirp = require('mkdirp'); var mkdirp = require('mkdirp');
var expect = require('expect.js'); var expect = require('expect.js');
var buffered = require('./util/buffered'); var buffered = require('./util/buffered');
var spawn = require('../'); var spawn = require('../');
var isWin = process.platform === 'win32'; var isWin = process.platform === 'win32';
// Fix AppVeyor tests because Git bin folder is in PATH and it has a "echo" program there // Fix AppVeyor tests because Git bin folder is in PATH and it has a "echo" program there
if (isWin) { if (isWin) {
...@@ -32,7 +32,7 @@ describe('cross-spawn-async', function () { ...@@ -32,7 +32,7 @@ describe('cross-spawn-async', function () {
// Give it some time, RIMRAF was giving problems on windows // Give it some time, RIMRAF was giving problems on windows
this.timeout(10000); this.timeout(10000);
rimraf(__dirname + '/tmp', function (err) { rimraf(__dirname + '/tmp', function () {
// Ignore errors, RIMRAF was giving problems on windows // Ignore errors, RIMRAF was giving problems on windows
next(null); next(null);
}); });
...@@ -66,7 +66,7 @@ describe('cross-spawn-async', function () { ...@@ -66,7 +66,7 @@ describe('cross-spawn-async', function () {
var file = __dirname + '/fixtures/shebang_noenv'; var file = __dirname + '/fixtures/shebang_noenv';
fs.writeFileSync(file, '#!' + nodejs + '\n\nprocess.stdout.write(\'shebang works!\');', { fs.writeFileSync(file, '#!' + nodejs + '\n\nprocess.stdout.write(\'shebang works!\');', {
mode: parseInt('0777', 8) mode: parseInt('0777', 8),
}); });
buffered(file, function (err, data, code) { buffered(file, function (err, data, code) {
...@@ -90,7 +90,24 @@ describe('cross-spawn-async', function () { ...@@ -90,7 +90,24 @@ describe('cross-spawn-async', function () {
it('should support shebang in executables with relative path', function (next) { it('should support shebang in executables with relative path', function (next) {
var executable = './' + path.relative(process.cwd(), __dirname + '/fixtures/shebang'); var executable = './' + path.relative(process.cwd(), __dirname + '/fixtures/shebang');
fs.writeFileSync(__dirname + '/tmp/shebang', '#!/usr/bin/env node\n\nprocess.stdout.write(\'yeah\');', { mode: parseInt('0777', 8) }); fs.writeFileSync(__dirname + '/tmp/shebang', '#!/usr/bin/env node\n\nprocess.stdout.write(\'yeah\');',
{ mode: parseInt('0777', 8) });
process.env.PATH = path.normalize(__dirname + '/tmp/') + path.delimiter + process.env.PATH;
buffered(executable, function (err, data, code) {
expect(err).to.not.be.ok();
expect(code).to.be(0);
expect(data).to.equal('shebang works!');
next();
});
});
it('should support shebang in executables with relative path that starts with `..`', function (next) {
var executable = '../' + path.basename(process.cwd()) + '/' + path.relative(process.cwd(), __dirname + '/fixtures/shebang');
fs.writeFileSync(__dirname + '/tmp/shebang', '#!/usr/bin/env node\n\nprocess.stdout.write(\'yeah\');',
{ mode: parseInt('0777', 8) });
process.env.PATH = path.normalize(__dirname + '/tmp/') + path.delimiter + process.env.PATH; process.env.PATH = path.normalize(__dirname + '/tmp/') + path.delimiter + process.env.PATH;
buffered(executable, function (err, data, code) { buffered(executable, function (err, data, code) {
...@@ -103,7 +120,8 @@ describe('cross-spawn-async', function () { ...@@ -103,7 +120,8 @@ describe('cross-spawn-async', function () {
}); });
it('should support shebang in executables with extensions', function (next) { it('should support shebang in executables with extensions', function (next) {
fs.writeFileSync(__dirname + '/tmp/shebang.js', '#!/usr/bin/env node\n\nprocess.stdout.write(\'shebang with extension\');', { mode: parseInt('0777', 8) }); fs.writeFileSync(__dirname + '/tmp/shebang.js', '#!/usr/bin/env node\n\nprocess.stdout.write(\'shebang with extension\');',
{ mode: parseInt('0777', 8) });
process.env.PATH = path.normalize(__dirname + '/tmp/') + path.delimiter + process.env.PATH; process.env.PATH = path.normalize(__dirname + '/tmp/') + path.delimiter + process.env.PATH;
buffered(__dirname + '/tmp/shebang.js', function (err, data, code) { buffered(__dirname + '/tmp/shebang.js', function (err, data, code) {
...@@ -154,12 +172,26 @@ describe('cross-spawn-async', function () { ...@@ -154,12 +172,26 @@ describe('cross-spawn-async', function () {
}); });
}); });
it('should handle arguments with quotes', function (next) {
buffered('node', [
__dirname + '/fixtures/echo',
'"foo"',
'foo"bar"foo',
], function (err, data, code) {
expect(err).to.not.be.ok();
expect(code).to.be(0);
expect(data).to.equal('"foo"\nfoo"bar"foo');
next();
});
});
it('should handle empty arguments', function (next) { it('should handle empty arguments', function (next) {
buffered('node', [ buffered('node', [
__dirname + '/fixtures/echo', __dirname + '/fixtures/echo',
'foo', 'foo',
'', '',
'bar' 'bar',
], function (err, data, code) { ], function (err, data, code) {
expect(err).to.not.be.ok(); expect(err).to.not.be.ok();
expect(code).to.be(0); expect(code).to.be(0);
...@@ -168,7 +200,7 @@ describe('cross-spawn-async', function () { ...@@ -168,7 +200,7 @@ describe('cross-spawn-async', function () {
buffered('echo', [ buffered('echo', [
'foo', 'foo',
'', '',
'bar' 'bar',
], function (err, data, code) { ], function (err, data, code) {
expect(err).to.not.be.ok(); expect(err).to.not.be.ok();
expect(code).to.be(0); expect(code).to.be(0);
...@@ -182,7 +214,7 @@ describe('cross-spawn-async', function () { ...@@ -182,7 +214,7 @@ describe('cross-spawn-async', function () {
it('should handle non-string arguments', function (next) { it('should handle non-string arguments', function (next) {
buffered('node', [ buffered('node', [
__dirname + '/fixtures/echo', __dirname + '/fixtures/echo',
1234 1234,
], function (err, data, code) { ], function (err, data, code) {
expect(err).to.not.be.ok(); expect(err).to.not.be.ok();
expect(code).to.be(0); expect(code).to.be(0);
...@@ -196,7 +228,7 @@ describe('cross-spawn-async', function () { ...@@ -196,7 +228,7 @@ describe('cross-spawn-async', function () {
buffered('node', [ buffered('node', [
__dirname + '/fixtures/echo', __dirname + '/fixtures/echo',
'I am', 'I am',
'André Cruz' 'André Cruz',
], function (err, data, code) { ], function (err, data, code) {
expect(err).to.not.be.ok(); expect(err).to.not.be.ok();
expect(code).to.be(0); expect(code).to.be(0);
...@@ -211,7 +243,7 @@ describe('cross-spawn-async', function () { ...@@ -211,7 +243,7 @@ describe('cross-spawn-async', function () {
__dirname + '/fixtures/echo', __dirname + '/fixtures/echo',
'foo', 'foo',
'\\"', '\\"',
'bar' 'bar',
], function (err, data, code) { ], function (err, data, code) {
expect(err).to.not.be.ok(); expect(err).to.not.be.ok();
expect(code).to.be(0); expect(code).to.be(0);
...@@ -226,7 +258,7 @@ describe('cross-spawn-async', function () { ...@@ -226,7 +258,7 @@ describe('cross-spawn-async', function () {
__dirname + '/fixtures/echo', __dirname + '/fixtures/echo',
'foo', 'foo',
'bar\\', 'bar\\',
'baz' 'baz',
], function (err, data, code) { ], function (err, data, code) {
expect(err).to.not.be.ok(); expect(err).to.not.be.ok();
expect(code).to.be(0); expect(code).to.be(0);
...@@ -251,7 +283,7 @@ describe('cross-spawn-async', function () { ...@@ -251,7 +283,7 @@ describe('cross-spawn-async', function () {
'|;', '|;',
'foo', 'foo',
', ', ', ',
'foo' 'foo',
], function (err, data, code) { ], function (err, data, code) {
expect(err).to.not.be.ok(); expect(err).to.not.be.ok();
expect(code).to.be(0); expect(code).to.be(0);
...@@ -280,7 +312,7 @@ describe('cross-spawn-async', function () { ...@@ -280,7 +312,7 @@ describe('cross-spawn-async', function () {
'|;', '|;',
'foo', 'foo',
', ', ', ',
'foo' 'foo',
], function (err, data, code) { ], function (err, data, code) {
expect(err).to.not.be.ok(); expect(err).to.not.be.ok();
expect(code).to.be(0); expect(code).to.be(0);
...@@ -408,7 +440,7 @@ describe('cross-spawn-async', function () { ...@@ -408,7 +440,7 @@ describe('cross-spawn-async', function () {
this.timeout(5000); this.timeout(5000);
spawned = spawn(__dirname + '/fixtures/shebang_enoent') spawned = spawn(__dirname + '/fixtures/shebang_enoent')
.on('error', function (err) { .on('error', function () {
spawned.removeAllListeners(); spawned.removeAllListeners();
clearTimeout(timeout); clearTimeout(timeout);
next(new Error('Should not emit error')); next(new Error('Should not emit error'));
...@@ -433,7 +465,7 @@ describe('cross-spawn-async', function () { ...@@ -433,7 +465,7 @@ describe('cross-spawn-async', function () {
this.timeout(5000); this.timeout(5000);
spawned = spawn(__dirname + '/fixtures/exit1') spawned = spawn(__dirname + '/fixtures/exit1')
.on('error', function (err) { .on('error', function () {
spawned.removeAllListeners(); spawned.removeAllListeners();
clearTimeout(timeout); clearTimeout(timeout);
next(new Error('Should not emit error')); next(new Error('Should not emit error'));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment