382f932d53
Applied console-aware spawn options to both non-PTY daemon paths. Windows children now stay attached when the host has a console and use CREATE_NO_WINDOW only for headless hosts. Fixes #6018
32 lines
836 B
TypeScript
32 lines
836 B
TypeScript
import { describe, expect, it } from "bun:test";
|
|
import { resolveDaemonSpawnOptions } from "./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 });
|
|
});
|
|
});
|