import assert from "node:assert/strict"; import { execFile } from "node:child_process"; import { mkdtemp, rm, writeFile } from "node:fs/promises"; import { tmpdir } from "node:os"; import { join } from "node:path"; import { promisify } from "node:util"; import { fileURLToPath } from "node:url"; import test from "node:test"; const execute = promisify(execFile); const lines = fileURLToPath(new URL("lines.mjs", import.meta.url)); async function check(shape, path) { const directory = await mkdtemp(join(tmpdir(), "anatomy-lines-round-")); try { const page = join(directory, "figure.html"); await writeFile(page, `
`); try { return { code: 0, ...await execute(process.execPath, [lines, page, "--wait", "0"], { timeout: 30000 }) }; } catch (error) { return { code: error.code, stdout: error.stdout, stderr: error.stderr }; } } finally { await rm(directory, { recursive: true, force: true }); } } test("line ends above a flat ellipse are floating", async () => { const result = await check('