| 8 | } |
| 9 | |
| 10 | async function findTestFilesIn(paths) { |
| 11 | const files = [] |
| 12 | for (const path of paths) { |
| 13 | const entry = await stat(path) |
| 14 | if (entry.isFile()) { |
| 15 | files.push(path) |
| 16 | continue |
| 17 | } |
| 18 | |
| 19 | for (const file of await readdir(path, { recursive: true }).then(x => |
| 20 | x |
| 21 | .filter(f => /-test\.(ts|tsx|js|jsx|mts|mjs)$/.test(f)) |
| 22 | .map(f => join(path, f)) |
| 23 | )) { |
| 24 | files.push(file) |
| 25 | } |
| 26 | } |
| 27 | return files |
| 28 | } |
| 29 | |
| 30 | const fileArgs = process.argv.slice(2).filter(a => !a.startsWith('--')) |
| 31 | const switchArgs = process.argv.slice(2).filter(a => a.startsWith('--')) |