feat: restore gateway HMR and add WRN formatting
This commit is contained in:
@@ -4,6 +4,7 @@ import {
|
||||
forwardAuthFailure,
|
||||
forwardAuthHeaders,
|
||||
gatewayProxyHeaders,
|
||||
gatewayRestartDelay,
|
||||
} from "../src/gateway.ts";
|
||||
|
||||
test("gateway uses platform-safe hostname defaults", () => {
|
||||
@@ -56,3 +57,11 @@ test("forward auth describes the original gateway request", () => {
|
||||
expect(headers.get("cookie")).toBe("session=abc");
|
||||
expect(headers.get("authorization")).toBe("Bearer token");
|
||||
});
|
||||
|
||||
test("gateway respawns development apps after an HMR restart exit", () => {
|
||||
expect(gatewayRestartDelay("development", 97, null)).toBe(0);
|
||||
expect(gatewayRestartDelay("development", 1, null)).toBe(1200);
|
||||
expect(gatewayRestartDelay("development", 0, null)).toBeNull();
|
||||
expect(gatewayRestartDelay("development", 97, "SIGTERM")).toBeNull();
|
||||
expect(gatewayRestartDelay("production", 97, null)).toBeNull();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user