Files
endorphin-tabularium-docs/apps/docs/scripts/test-auth.mjs
codex-bot 9fcfbdb694
Verify and deploy Tabularium / verify-and-deploy (push) Successful in 5m28s
Protect Tabularium with persistent authenticator-code login
2026-10-27 21:48:16 +08:00

24 lines
677 B
JavaScript

import { build } from "esbuild";
import { mkdtemp, rm } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { spawnSync } from "node:child_process";
const dir = await mkdtemp(join(tmpdir(), "tabularium-auth-tests-"));
try {
const file = join(dir, "auth.test.cjs");
await build({
entryPoints: ["tests/auth.test.ts"],
bundle: true,
platform: "node",
target: "node22",
format: "cjs",
outfile: file,
});
const result = spawnSync(process.execPath, ["--test", file], {
stdio: "inherit",
});
process.exitCode = result.status ?? 1;
} finally {
await rm(dir, { recursive: true, force: true });
}