(dir)
| 46 | process.exit(res.status ?? 1); |
| 47 | |
| 48 | function listTestFiles(dir) { |
| 49 | /** @type {string[]} */ |
| 50 | const out = []; |
| 51 | |
| 52 | for (const entry of fs.readdirSync(dir, { withFileTypes: true })) { |
| 53 | const full = path.join(dir, entry.name); |
| 54 | if (entry.isDirectory()) { |
| 55 | out.push(...listTestFiles(full)); |
| 56 | continue; |
| 57 | } |
| 58 | |
| 59 | if (entry.isFile() && entry.name.endsWith('.test.ts')) { |
| 60 | out.push(full); |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | out.sort(); |
| 65 | return out; |
| 66 | } |