test: tighten gateway nullable assertions · openclaw/openclaw@b4a7178
steipete
·
2026-05-08
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -118,9 +118,9 @@ describe("probeGateway auth integration", () => {
|
118 | 118 | |
119 | 119 | expect(result.ok).toBe(true); |
120 | 120 | expect(result.error).toBeNull(); |
121 | | -expect(result.health).not.toBeNull(); |
122 | | -expect(result.status).not.toBeNull(); |
123 | | -expect(result.configSnapshot).not.toBeNull(); |
| 121 | +expectRecord(result.health, "probe health"); |
| 122 | +expectRecord(result.status, "probe status"); |
| 123 | +expectRecord(result.configSnapshot, "probe config snapshot"); |
124 | 124 | }); |
125 | 125 | }); |
126 | 126 | }); |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -212,7 +212,7 @@ describe("probeGateway", () => {
|
212 | 212 | |
213 | 213 | expect(eventLoopReadyState.calls).toHaveLength(1); |
214 | 214 | expect(eventLoopReadyState.calls[0]?.maxWaitMs).toBe(1_000); |
215 | | -expect(gatewayClientState.options).not.toBeNull(); |
| 215 | +expect(gatewayClientState.options?.url).toBe("ws://127.0.0.1:18789"); |
216 | 216 | expect(gatewayClientState.startCalls).toBe(1); |
217 | 217 | }); |
218 | 218 | |
@@ -243,7 +243,7 @@ describe("probeGateway", () => {
|
243 | 243 | }); |
244 | 244 | expect(eventLoopReadyState.calls).toHaveLength(1); |
245 | 245 | expect(eventLoopReadyState.calls[0]?.maxWaitMs).toBe(250); |
246 | | -expect(gatewayClientState.options).not.toBeNull(); |
| 246 | +expect(gatewayClientState.options?.url).toBe("ws://127.0.0.1:18789"); |
247 | 247 | expect(gatewayClientState.startCalls).toBe(0); |
248 | 248 | }); |
249 | 249 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -79,7 +79,6 @@ describe("gateway device.pair.approve caller scope guard", () => {
|
79 | 79 | expect(approve.error?.message).toBe("missing scope: operator.admin"); |
80 | 80 | |
81 | 81 | const paired = await getPairedDevice(approverIdentity.identity.deviceId); |
82 | | -expect(paired).not.toBeNull(); |
83 | 82 | expect(paired?.approvedScopes).toEqual(["operator.admin"]); |
84 | 83 | } finally { |
85 | 84 | pairingWs?.close(); |
@@ -138,7 +137,7 @@ describe("gateway device.pair.approve caller scope guard", () => {
|
138 | 137 | expect(reject.error?.message).toBe("device pairing rejection denied"); |
139 | 138 | |
140 | 139 | const stillPending = await getPendingDevicePairing(request.request.requestId); |
141 | | -expect(stillPending).not.toBeNull(); |
| 140 | +expect(stillPending?.requestId).toBe(request.request.requestId); |
142 | 141 | } finally { |
143 | 142 | pairingWs?.close(); |
144 | 143 | started.ws.close(); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。