Build: update Sizzle to 2.2.1
[jquery.git] / build / tasks / node_smoke_tests.js
blob1b860b1409c480834c109e0a5d04aa3c0d7fa555
1 module.exports = function( grunt ) {
3         "use strict";
5         var fs = require( "fs" ),
6                 spawnTest = require( "./lib/spawn_test.js" ),
7                 testsDir = "./test/node_smoke_tests/",
8                 nodeSmokeTests = [ "babel:nodeSmokeTests" ];
10         // Fire up all tests defined in test/node_smoke_tests/*.js in spawned sub-processes.
11         // All the files under test/node_smoke_tests/*.js are supposed to exit with 0 code
12         // on success or another one on failure. Spawning in sub-processes is
13         // important so that the tests & the main process don't interfere with
14         // each other, e.g. so that they don't share the require cache.
16         fs.readdirSync( testsDir )
17                 .filter( function( testFilePath ) {
18                         return fs.statSync( testsDir + testFilePath ).isFile() &&
19                                 /\.js$/.test( testFilePath );
20                 } )
21                 .forEach( function( testFilePath ) {
22                         var taskName = "node_" + testFilePath.replace( /\.js$/, "" );
24                         grunt.registerTask( taskName, function() {
25                                 spawnTest( this.async(), "test/node_smoke_tests/" + testFilePath );
26                         } );
28                         nodeSmokeTests.push( taskName );
29                 } );
31         grunt.registerTask( "node_smoke_tests", nodeSmokeTests );