1var readdirSync = require('fs').readdirSync 2var spawnSync = require('child_process').spawnSync 3var extname = require('path').extname 4 5var files = readdirSync(__dirname) 6files.forEach(function(file){ 7 if (extname(file) !== '.js' || file === 'run.js') 8 return 9 console.log(`*** ${file} ***`) 10 var result = spawnSync(process.argv0, [file], { stdio: 'inherit', cwd: __dirname} ) 11 if (result.status !== 0) 12 process.exit(result.status) 13}) 14