Skip to content

Commit

Permalink
test: use executable in spawn() test
Browse files Browse the repository at this point in the history
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.

Reviewed-by: Sam Roberts <sam@strongloop.com>
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
  • Loading branch information
cjihrig authored and Julien Gilli committed Jan 13, 2015
1 parent e64ee2b commit 1070377
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/simple/test-child-process-spawn-typeerror.js
Expand Up @@ -100,10 +100,11 @@ assert.doesNotThrow(function() { spawn(cmd, a, o); });
assert.doesNotThrow(function() { spawn(cmd, o); });

// Variants of undefined as explicit 'no argument' at a position
assert.doesNotThrow(function() { execFile(empty, u, o); });
assert.doesNotThrow(function() { execFile(empty, a, u); });
assert.doesNotThrow(function() { execFile(empty, n, o); });
assert.doesNotThrow(function() { execFile(empty, a, n); });
assert.doesNotThrow(function() { spawn(cmd, u, o); });
assert.doesNotThrow(function() { spawn(cmd, a, u); });

assert.throws(function() { spawn(cmd, n, o); }, TypeError);
assert.throws(function() { spawn(cmd, a, n); }, TypeError);

assert.throws(function() { spawn(cmd, s); }, TypeError);
assert.doesNotThrow(function() { spawn(cmd, a, s); }, TypeError);
Expand Down

0 comments on commit 1070377

Please sign in to comment.