test: clarify small core accepted assertions · openclaw/openclaw@8221f09
steipete
·
2026-05-08
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -538,7 +538,7 @@ describe("OpenAIWebSocketManager", () => {
|
538 | 538 | |
539 | 539 | it("is safe to call before connect()", () => { |
540 | 540 | const manager = buildManager(); |
541 | | -expect(() => manager.close()).not.toThrow(); |
| 541 | +expect(manager.close()).toBeUndefined(); |
542 | 542 | expect(manager.connectionState).toBe("closed"); |
543 | 543 | }); |
544 | 544 | }); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -27,14 +27,14 @@ describe("subscribeEmbeddedPiSession", () => {
|
27 | 27 | blockReplyBreak: "text_end", |
28 | 28 | }); |
29 | 29 | |
30 | | -// This should not throw even without onBlockReplyFlush |
31 | | -expect(() => { |
| 30 | +// Missing onBlockReplyFlush should still accept streaming events. |
| 31 | +expect( |
32 | 32 | handler?.({ |
33 | 33 | type: "tool_execution_start", |
34 | 34 | toolName: "bash", |
35 | 35 | toolCallId: "tool-no-flush", |
36 | 36 | args: { command: "echo test" }, |
37 | | -}); |
38 | | -}).not.toThrow(); |
| 37 | +}), |
| 38 | +).toBeUndefined(); |
39 | 39 | }); |
40 | 40 | }); |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -328,11 +328,11 @@ describe("TUI shutdown safety", () => {
|
328 | 328 | }); |
329 | 329 | |
330 | 330 | it("swallows only ignorable stop errors", () => { |
331 | | -expect(() => { |
| 331 | +expect( |
332 | 332 | stopTuiSafely(() => { |
333 | 333 | throw new Error("setRawMode EBADF"); |
334 | | -}); |
335 | | -}).not.toThrow(); |
| 334 | +}), |
| 335 | +).toBeUndefined(); |
336 | 336 | }); |
337 | 337 | |
338 | 338 | it("rethrows non-ignorable stop errors", () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。