mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 04:51:25 +00:00
test: dedupe repeated validation and throw assertions
This commit is contained in:
@@ -333,9 +333,16 @@ describe("buildGatewayConnectionDetails", () => {
|
||||
resolveGatewayPort.mockReturnValue(18789);
|
||||
pickPrimaryTailnetIPv4.mockReturnValue(undefined);
|
||||
|
||||
expect(() => buildGatewayConnectionDetails()).toThrow("SECURITY ERROR");
|
||||
expect(() => buildGatewayConnectionDetails()).toThrow("plaintext ws://");
|
||||
expect(() => buildGatewayConnectionDetails()).toThrow("wss://");
|
||||
let thrown: unknown;
|
||||
try {
|
||||
buildGatewayConnectionDetails();
|
||||
} catch (error) {
|
||||
thrown = error;
|
||||
}
|
||||
expect(thrown).toBeInstanceOf(Error);
|
||||
expect((thrown as Error).message).toContain("SECURITY ERROR");
|
||||
expect((thrown as Error).message).toContain("plaintext ws://");
|
||||
expect((thrown as Error).message).toContain("wss://");
|
||||
});
|
||||
|
||||
it("allows ws:// for loopback addresses in local mode", () => {
|
||||
|
||||
Reference in New Issue
Block a user