t3-code-android-nightly/.repos/alchemy-effect/packages/alchemy/test/Cli/fixtures/shutdown-feedback-fixture.ts
Julius Marminge e3c85ead63
chore(refs): sync Effect and Alchemy references to rc.115 and beta.78 (#12327)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-09-17 23:21:25 -07:00

29 lines
960 B
TypeScript

// Relative import (not `@/` alias) so this fixture runs as a bare bun/node
// child without a paths-aware loader. Excluded from the test project's
// typecheck (see tsconfig.test.json) because the relative path crosses
// composite-project boundaries.
import * as Effect from "effect/Effect";
import {
installShutdownFeedback,
suppressInterruptMessages,
} from "../../../src/Cli/commands/errors.ts";
if (process.env.SHUTDOWN_FIXTURE_SUPPRESS === "1") {
Effect.runSync(suppressInterruptMessages);
}
Effect.runSync(installShutdownFeedback);
// Simulates a teardown that takes this long after the first SIGINT. Without
// it the fixture never exits on its own (a hanging cleanup).
const exitAfter = Number.parseInt(
process.env.SHUTDOWN_FIXTURE_EXIT_AFTER_MS ?? "",
10,
);
if (Number.isFinite(exitAfter)) {
process.once("SIGINT", () => {
setTimeout(() => process.exit(0), exitAfter);
});
}
console.log("ready");
setInterval(() => {}, 1000);