From 781647b1820206e95e5c32be2dffb20e9096b1e4 Mon Sep 17 00:00:00 2001 From: Michał Gołębiowski-Owczarek Date: Wed, 20 Sep 2017 15:32:35 +0200 Subject: Build: Drop cross-spawn, use child_process.spawn shell option --- build/tasks/lib/spawn_test.js | 10 ++++++---- build/tasks/node_smoke_tests.js | 2 +- build/tasks/promises_aplus_tests.js | 8 ++++---- 3 files changed, 11 insertions(+), 9 deletions(-) (limited to 'build') diff --git a/build/tasks/lib/spawn_test.js b/build/tasks/lib/spawn_test.js index 34353a783..146155411 100644 --- a/build/tasks/lib/spawn_test.js +++ b/build/tasks/lib/spawn_test.js @@ -3,11 +3,13 @@ // Run Node with provided parameters: the first one being the Grunt // done function and latter ones being files to be tested. // See the comment in ../node_smoke_tests.js for more information. -module.exports = function spawnTest( done ) { - var testPaths = [].slice.call( arguments, 1 ), - spawn = require( "cross-spawn" ); +module.exports = function spawnTest( done, command ) { + var spawn = require( "child_process" ).spawn; - spawn( "node", testPaths, { stdio: "inherit" } ) + spawn( command, { + stdio: "inherit", + shell: true + } ) .on( "close", function( code ) { done( code === 0 ); } ); diff --git a/build/tasks/node_smoke_tests.js b/build/tasks/node_smoke_tests.js index 1b860b140..157aa80af 100644 --- a/build/tasks/node_smoke_tests.js +++ b/build/tasks/node_smoke_tests.js @@ -22,7 +22,7 @@ module.exports = function( grunt ) { var taskName = "node_" + testFilePath.replace( /\.js$/, "" ); grunt.registerTask( taskName, function() { - spawnTest( this.async(), "test/node_smoke_tests/" + testFilePath ); + spawnTest( this.async(), "node test/node_smoke_tests/" + testFilePath ); } ); nodeSmokeTests.push( taskName ); diff --git a/build/tasks/promises_aplus_tests.js b/build/tasks/promises_aplus_tests.js index a0118d1f0..c634da5f7 100644 --- a/build/tasks/promises_aplus_tests.js +++ b/build/tasks/promises_aplus_tests.js @@ -9,15 +9,15 @@ module.exports = function( grunt ) { grunt.registerTask( "promises_aplus_tests:deferred", function() { spawnTest( this.async(), - "./node_modules/.bin/promises-aplus-tests", - "test/promises_aplus_adapters/deferred.js" + __dirname + "/../../node_modules/.bin/promises-aplus-tests" + + " test/promises_aplus_adapters/deferred.js" ); } ); grunt.registerTask( "promises_aplus_tests:when", function() { spawnTest( this.async(), - "./node_modules/.bin/promises-aplus-tests", - "test/promises_aplus_adapters/when.js" + __dirname + "/../../node_modules/.bin/promises-aplus-tests" + + " test/promises_aplus_adapters/when.js" ); } ); }; -- cgit v1.2.3