(dir)
| 25 | process.exit(res.status ?? 1); |
| 26 | |
| 27 | function listTestFiles(dir) { |
| 28 | /** @type {string[]} */ |
| 29 | const out = []; |
| 30 | |
| 31 | for (const entry of fs.readdirSync(dir, { withFileTypes: true })) { |
| 32 | const full = path.join(dir, entry.name); |
| 33 | if (entry.isDirectory()) { |
| 34 | out.push(...listTestFiles(full)); |
| 35 | continue; |
| 36 | } |
| 37 | |
| 38 | if (entry.isFile() && entry.name.endsWith('.test.ts')) { |
| 39 | out.push(full); |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | // Deterministic order. |
| 44 | out.sort(); |
| 45 | return out; |
| 46 | } |