Build: Drop cross-spawn, use child_process.spawn shell option

This commit is contained in:
Michał Gołębiowski-Owczarek 2017-09-20 15:32:35 +02:00 committed by Michał Gołębiowski-Owczarek
parent 90bac40a51
commit 781647b182
5 changed files with 11 additions and 58 deletions

View File

@ -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 );
} );

View File

@ -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 );

View File

@ -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"
);
} );
};

48
package-lock.json generated
View File

@ -986,17 +986,6 @@
"integrity": "sha1-etIg1v/c0Rn5/BJ6d3LKzqOQpLo=",
"dev": true
},
"cross-spawn": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz",
"integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=",
"dev": true,
"requires": {
"lru-cache": "4.1.1",
"shebang-command": "1.2.0",
"which": "1.2.14"
}
},
"cryptiles": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz",
@ -3998,16 +3987,6 @@
"signal-exit": "3.0.2"
}
},
"lru-cache": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz",
"integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==",
"dev": true,
"requires": {
"pseudomap": "1.0.2",
"yallist": "2.1.2"
}
},
"map-obj": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz",
@ -4657,12 +4636,6 @@
}
}
},
"pseudomap": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz",
"integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=",
"dev": true
},
"punycode": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz",
@ -5075,21 +5048,6 @@
"integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=",
"dev": true
},
"shebang-command": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
"integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=",
"dev": true,
"requires": {
"shebang-regex": "1.0.0"
}
},
"shebang-regex": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
"integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=",
"dev": true
},
"sigmund": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz",
@ -5661,12 +5619,6 @@
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz",
"integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=",
"dev": true
},
"yallist": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz",
"integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=",
"dev": true
}
}
}

View File

@ -29,7 +29,6 @@
"babel-plugin-transform-es2015-for-of": "7.0.0-beta.0",
"commitplease": "2.7.10",
"core-js": "2.4.1",
"cross-spawn": "5.1.0",
"eslint-config-jquery": "1.0.1",
"grunt": "1.0.1",
"grunt-babel": "7.0.0",