mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-09-05 08:10:39 +00:00
Keep project config and checked-in workflows under .fabro so they stay out of normal repo listings. Update config discovery, CLI project commands, fixtures, docs, and checked-in workflow paths to use .fabro/project.toml and .fabro/workflows/*.
32 lines
894 B
TypeScript
32 lines
894 B
TypeScript
import { test, expect } from "bun:test";
|
|
|
|
const root = Bun.fileURLToPath(new URL("..", import.meta.url));
|
|
|
|
test("watch mode keeps running until interrupted", async () => {
|
|
const process = Bun.spawn([
|
|
"bun",
|
|
"run",
|
|
"scripts/build.ts",
|
|
"--watch",
|
|
], {
|
|
cwd: root,
|
|
stdout: "pipe",
|
|
stderr: "pipe",
|
|
});
|
|
|
|
const result = await Promise.race([
|
|
process.exited.then((code) => ({ kind: "exited" as const, code })),
|
|
Bun.sleep(1000).then(() => ({ kind: "running" as const })),
|
|
]);
|
|
|
|
if (result.kind === "exited") {
|
|
const stderr = await new Response(process.stderr).text();
|
|
const stdout = await new Response(process.stdout).text();
|
|
throw new Error(
|
|
`watch process exited unexpectedly with code ${result.code}\nstdout:\n${stdout}\nstderr:\n${stderr}`,
|
|
);
|
|
}
|
|
|
|
process.kill("SIGINT");
|
|
expect([0, 130]).toContain(await process.exited);
|
|
});
|