import assert from 'node:assert/strict'; import { execFileSync } from 'node:child_process'; import { existsSync, readFileSync, readdirSync, writeFileSync } from 'node:fs'; import path from 'node:path'; import vm from 'node:vm'; import { fileURLToPath } from 'node:url'; const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..'); const PUBLIC = path.join(ROOT, 'public'); const requested = new Set(process.argv.slice(2)); const wants = (suite) => requested.size === 0 || requested.has('all') || requested.has(suite); const failures = []; function read(relativePath) { return readFileSync(path.join(ROOT, relativePath), 'utf8'); } function visibleText(html) { return html .replace(/
/gi, ' ') .replace(/