Cover NaN and infinite runtime port rejection
Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
1 parent
2d7754c19f
commit
cab673a105
1 file changed
+18
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user