]> source.dussan.org Git - jquery.git/commitdiff
Build: Drop cross-spawn, use child_process.spawn shell option
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>
Wed, 20 Sep 2017 13:32:35 +0000 (15:32 +0200)
committerMichał Gołębiowski-Owczarek <m.goleb@gmail.com>
Mon, 25 Sep 2017 17:27:50 +0000 (19:27 +0200)
build/tasks/lib/spawn_test.js
build/tasks/node_smoke_tests.js
build/tasks/promises_aplus_tests.js
package-lock.json
package.json

index 34353a7836e55bc4c49720e6ead8148bc0fecf08..1461554117f9ffee4d411ec72a4224f6ac24cff7 100644 (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 );
                } );
index 1b860b1409c480834c109e0a5d04aa3c0d7fa555..157aa80af27349a4c05906ff8f0ad8f925b4e824 100644 (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 );
index a0118d1f03cff8e78d8613bd428bc07ff5a85d93..c634da5f7b0f94197f25adeb6e942ba816368e0a 100644 (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"
                );
        } );
 };
index d9fcc215b8d82aef3d9c45ce7bf4704247156f04..135ed3c38cb48508658ae28cef034d38f739b9be 100644 (file)
       "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",
         "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",
         }
       }
     },
-    "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",
       "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",
       "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
     }
   }
 }
index 880662b2404eff68c19ab0ab9064c978906127c1..f273608b8284b9ba3dba03ae255d6da2b793f4db 100644 (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",