diff options
author | Michał Gołębiowski-Owczarek <m.goleb@gmail.com> | 2017-09-20 15:32:35 +0200 |
---|---|---|
committer | Michał Gołębiowski-Owczarek <m.goleb@gmail.com> | 2017-09-25 19:27:50 +0200 |
commit | 781647b1820206e95e5c32be2dffb20e9096b1e4 (patch) | |
tree | 48e0bbe8a030e9e0c6fae183f4163a6278dd0a00 /build | |
parent | 90bac40a5123038c94a6fd8c1fde7fbe758b08c7 (diff) | |
download | jquery-781647b1820206e95e5c32be2dffb20e9096b1e4.tar.gz jquery-781647b1820206e95e5c32be2dffb20e9096b1e4.zip |
Build: Drop cross-spawn, use child_process.spawn shell option
Diffstat (limited to 'build')
-rw-r--r-- | build/tasks/lib/spawn_test.js | 10 | ||||
-rw-r--r-- | build/tasks/node_smoke_tests.js | 2 | ||||
-rw-r--r-- | build/tasks/promises_aplus_tests.js | 8 |
3 files changed, 11 insertions, 9 deletions
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" ); } ); }; |