Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/thatstupidcomputer / scripts/test.mjs |
| Date | Not specified in source |
| Repository | Janady13/thatstupidcomputer |
| Revision | 57555cde46910102dd25d6c1c1fb2c359e9655bd |
| Branch | main |
| Path or archive member | scripts/test.mjs |
| Original SHA-256 | c64bd124de45895fc855d4fe94a77a318e2f7e7fc6c193cae57391e83ff76daf |
| Git blob SHA | a2e2a927d312a2881ca038031976b5da5f9762b7 |
| Reading-copy SHA-256 | c64bd124de45895fc855d4fe94a77a318e2f7e7fc6c193cae57391e83ff76daf |
Recovered source transcript
Download complete source text ↓15 lines · 0.8 KB
import { readdirSync } from 'node:fs';
import { join } from 'node:path';
import { spawnSync } from 'node:child_process';
import { fileURLToPath } from 'node:url';
const root = fileURLToPath(new URL('..', import.meta.url));
process.chdir(root);
function collect(dir) {
return readdirSync(dir, { withFileTypes: true }).flatMap(entry => entry.isDirectory() ? collect(join(dir, entry.name)) : /\.test\.(?:ts|mjs)$/.test(entry.name) ? [join(dir, entry.name)] : []);
}
const tests = collect('tests').sort();
if (!tests.length) throw new Error('No tests found.');
const result = spawnSync(process.execPath, ['--import', 'tsx', '--test', ...tests], { stdio: 'inherit', cwd: root, timeout: 180000 });
if (result.error) { console.error(result.error.message); process.exitCode = 1; }
else process.exitCode = result.status ?? 1;