Browse Source

test: backport use executable in spawn() test

Backport 10703774f0 from the v0.12 branch.

Currently, the test-child-process-spawn-typeerror.js is
calling execFile() on a JavaScript source file, which is
causing failures on Windows. This commit switches to calling
spawn() on an actual executable.

Fixes #8930.

Signed-off-by: Julien Gilli <julien.gilli@joyent.com>
v0.10.36-release
cjihrig 10 years ago
committed by Julien Gilli
parent
commit
0a430b9aec
  1. 8
      test/simple/test-child-process-spawn-typeerror.js

8
test/simple/test-child-process-spawn-typeerror.js

@ -41,10 +41,10 @@ assert.doesNotThrow(function() { spawn(cmd, a, o); });
assert.doesNotThrow(function() { spawn(cmd, o); }); assert.doesNotThrow(function() { spawn(cmd, o); });
// Variants of undefined as explicit 'no argument' at a position // Variants of undefined as explicit 'no argument' at a position
assert.doesNotThrow(function() { execFile(empty, u, o); }); assert.doesNotThrow(function() { spawn(cmd, u, o); });
assert.doesNotThrow(function() { execFile(empty, a, u); }); assert.doesNotThrow(function() { spawn(cmd, a, u); });
assert.doesNotThrow(function() { execFile(empty, n, o); }); assert.doesNotThrow(function() { spawn(cmd, n, o); });
assert.doesNotThrow(function() { execFile(empty, a, n); }); assert.doesNotThrow(function() { spawn(cmd, a, n); });
assert.throws(function() { spawn(cmd, s); }, TypeError); assert.throws(function() { spawn(cmd, s); }, TypeError);
assert.doesNotThrow(function() { spawn(cmd, a, s); }, TypeError); assert.doesNotThrow(function() { spawn(cmd, a, s); }, TypeError);

Loading…
Cancel
Save