Files
2026-07-27 16:43:53 +02:00

32 lines
851 B
TypeScript

import { describe, expect, it } from "bun:test";
import { resolveDaemonSpawnOptions } from "../../src/launch/spawn-options";
describe("resolveDaemonSpawnOptions", () => {
it("hides Windows daemons when the host has no console", () => {
expect(
resolveDaemonSpawnOptions({
platform: "win32",
hostHasInheritableConsole: false,
}),
).toEqual({ detached: false, windowsHide: true });
});
it("inherits the Windows host console instead of detaching", () => {
expect(
resolveDaemonSpawnOptions({
platform: "win32",
hostHasInheritableConsole: true,
}),
).toEqual({ detached: false, windowsHide: false });
});
it("keeps POSIX daemons in their own session", () => {
expect(
resolveDaemonSpawnOptions({
platform: "linux",
hostHasInheritableConsole: false,
}),
).toEqual({ detached: true });
});
});