From 10703774f01a4005fc74d6b4131c713259e81657 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Mon, 22 Dec 2014 16:39:51 -0500 Subject: [PATCH] test: use executable in spawn() test 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 Reviewed-by: Julien Gilli --- test/simple/test-child-process-spawn-typeerror.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/simple/test-child-process-spawn-typeerror.js b/test/simple/test-child-process-spawn-typeerror.js index 27de3550078..d05c20b2d97 100644 --- a/test/simple/test-child-process-spawn-typeerror.js +++ b/test/simple/test-child-process-spawn-typeerror.js @@ -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);