Skip to content

Commit cec8d21

Browse files
committed
test: cover daemon deep connection diagnostics
1 parent b5d0058 commit cec8d21

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/cli/daemon-cli.coverage.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ const inspectPortUsage = vi.fn(async (port: number) => ({
2828
listeners: [],
2929
hints: [],
3030
}));
31+
const inspectPortConnections = vi.fn(async (port: number) => ({
32+
port,
33+
connections: [],
34+
}));
3135

3236
function collectMatching<T, U>(
3337
items: readonly T[],
@@ -114,6 +118,7 @@ vi.mock("../daemon/inspect.js", () => ({
114118
}));
115119

116120
vi.mock("../infra/ports.js", () => ({
121+
inspectPortConnections: (port: number) => inspectPortConnections(port),
117122
inspectPortUsage: (port: number) => inspectPortUsage(port),
118123
formatPortDiagnostics: () => ["Port 18789 is already in use."],
119124
}));
@@ -192,6 +197,7 @@ describe("daemon-cli coverage", () => {
192197
serviceReadCommand.mockResolvedValue(null);
193198
resolveGatewayProbeAuthSafeWithSecretInputs.mockClear();
194199
findExtraGatewayServices.mockClear();
200+
inspectPortConnections.mockClear();
195201
buildGatewayInstallPlan.mockClear();
196202
});
197203

0 commit comments

Comments
 (0)