parent
f5fb563535
commit
a8c3109b9a
1 changed files with 22 additions and 0 deletions
@ -0,0 +1,22 @@ |
||||
const { spawn } = require('child_process') |
||||
const fs = require('fs') |
||||
|
||||
const dirs = ['./test', './tests'] |
||||
|
||||
if (!dirs.some(fs.existsSync)) { |
||||
throw Error("Could not find any test directories, looked for: " + dirs) |
||||
} |
||||
|
||||
const test_dirs = dirs.filter(fs.existsSync) |
||||
|
||||
test_dirs.forEach(test_dir => { |
||||
const files = fs.readdirSync(test_dir) |
||||
|
||||
if (files.length === 0) { |
||||
throw Error("Could not find test files in " + test_dir) |
||||
} |
||||
|
||||
const childs = files.map(file =>
|
||||
spawn('node', [`${test_dir}/${file}`], { stdio: 'inherit' })
|
||||
) |
||||
}) |
Loading…
Reference in new issue