test: quote websocket constructor errors · openclaw/openclaw@df6bc36
shakkernerd
·
2026-05-13
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -384,7 +384,9 @@ describe("GatewayBrowserClient", () => {
|
384 | 384 | const closeError = requireRecord(close.error, "close error"); |
385 | 385 | const closeErrorDetails = requireRecord(closeError.details, "close error details"); |
386 | 386 | expect(closeError.code).toBe("BROWSER_WEBSOCKET_SECURITY_ERROR"); |
387 | | -expect(String(closeError.message)).toContain("Use wss://"); |
| 387 | +expect(closeError.message).toBe( |
| 388 | +"Browser refused the Gateway WebSocket for security reasons. Use wss:// when the Control UI is served over HTTPS/Tailscale Serve, or open the loopback dashboard at http://127.0.0.1:18789.", |
| 389 | +); |
388 | 390 | expect(closeErrorDetails.code).toBe("BROWSER_WEBSOCKET_SECURITY_ERROR"); |
389 | 391 | expect(closeErrorDetails.browserErrorName).toBe("SecurityError"); |
390 | 392 | expect(wsInstances).toHaveLength(0); |
@@ -420,7 +422,7 @@ describe("GatewayBrowserClient", () => {
|
420 | 422 | const closeError = requireRecord(close.error, "close error"); |
421 | 423 | const closeErrorDetails = requireRecord(closeError.details, "close error details"); |
422 | 424 | expect(closeError.code).toBe("BROWSER_WEBSOCKET_CONSTRUCTOR_ERROR"); |
423 | | -expect(String(closeError.message)).toContain("Could not create the Gateway WebSocket"); |
| 425 | +expect(closeError.message).toBe("Could not create the Gateway WebSocket: constructor failed"); |
424 | 426 | expect(closeErrorDetails.code).toBe("BROWSER_WEBSOCKET_CONSTRUCTOR_ERROR"); |
425 | 427 | expect(closeErrorDetails.browserErrorName).toBe("TypeError"); |
426 | 428 | expect(closeErrorDetails.browserMessage).toBe("constructor failed"); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。