import { readdirSync } from "node:fs"; import { spawnSync } from "node:child_process"; import { join } from "node:path"; const files = readdirSync("test").filter((file) => file.endsWith(".test.mjs")).sort().map((file) => join("test", file)); const result = spawnSync(process.execPath, ["--import", "tsx", "--test", ...files], { stdio: "inherit" }); if (result.error) throw result.error; process.exit(result.status ?? 1);