-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathrun-int.js
42 lines (33 loc) · 966 Bytes
/
run-int.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/* eslint-disable @typescript-eslint/no-require-imports */
const fs = require('fs');
const path = require('path');
const childProcess = require('child_process');
const runTest = (file) => {
console.log();
console.log(`Running test: ${file}`);
childProcess.execSync(`npx jest --testTimeout 10000 ${file}`);
console.log();
};
let testsRun = 0;
let skipUntil = process.argv[2];
let skip = skipUntil !== undefined;
const execDir = (dir) => {
const content = fs.readdirSync(dir);
for (const entry of content) {
if (entry.includes('.')) {
if (entry.endsWith('.spec.ts')) {
if (skip && !entry.includes(skipUntil)) {
console.log(`Skipping ${path.join(dir, entry)}`);
continue;
}
skip = false;
runTest(path.join(dir, entry));
testsRun++;
}
continue;
}
execDir(path.join(dir, entry));
}
};
execDir('test/integration');
console.log(`Ran ${testsRun} test suites`);