1// Relative import (not `@/` alias) so this fixture runs as a bare bun/node
2// child without a paths-aware loader. Excluded from the test project's
3// typecheck (see tsconfig.test.json) because the relative path crosses
4// composite-project boundaries.
5import * as Effect from "effect/Effect";
6import {
7 installShutdownFeedback,
8 suppressInterruptMessages,
9} from "../../../src/Cli/commands/errors.ts";
10
11if (process.env.SHUTDOWN_FIXTURE_SUPPRESS === "1") {
12 Effect.runSync(suppressInterruptMessages);
13}
14Effect.runSync(installShutdownFeedback);
15
16// Simulates a teardown that takes this long after the first SIGINT. Without
17// it the fixture never exits on its own (a hanging cleanup).
18const exitAfter = Number.parseInt(
19 process.env.SHUTDOWN_FIXTURE_EXIT_AFTER_MS ?? "",
20 10,
21);
22if (Number.isFinite(exitAfter)) {
23 process.once("SIGINT", () => {
24 setTimeout(() => process.exit(0), exitAfter);
25 });
26}
27
28console.log("ready");
29setInterval(() => {}, 1000);