Cover NaN and infinite runtime port rejection

Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
Cursor AgentandTheo Browne committed 2026-02-10 02:18:33 +00:00
1 parent 2d7754c19f
commit cab673a105
1 file changed
+18
+18
View File
@@ -185,6 +185,24 @@ describe("runtimeApiServer", () => {
).rejects.toThrow("Invalid runtime port");
});
it("rejects startup when runtime port is NaN", async () => {
await expect(
startRuntimeApiServer({
port: Number.NaN,
launchCwd: process.cwd(),
}),
).rejects.toThrow("Invalid runtime port");
});
it("rejects startup when runtime port is infinite", async () => {
await expect(
startRuntimeApiServer({
port: Number.POSITIVE_INFINITY,
launchCwd: process.cwd(),
}),
).rejects.toThrow("Invalid runtime port");
});
it("allows runtime server close to be called multiple times", async () => {
const server = await startRuntimeApiServer({
port: 0,