test: check sandbox command messages · openclaw/openclaw@948e879
shakkernerd
·
2026-05-11
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -79,11 +79,13 @@ function setupDefaultMocks() {
|
79 | 79 | } |
80 | 80 | |
81 | 81 | function expectLogContains(runtime: ReturnType<typeof createMockRuntime>, text: string) { |
82 | | -expect(runtime.log).toHaveBeenCalledWith(expect.stringContaining(text)); |
| 82 | +const loggedMessages = runtime.log.mock.calls.map(([message]) => String(message)); |
| 83 | +expect(loggedMessages.some((message) => message.includes(text))).toBe(true); |
83 | 84 | } |
84 | 85 | |
85 | 86 | function expectErrorContains(runtime: ReturnType<typeof createMockRuntime>, text: string) { |
86 | | -expect(runtime.error).toHaveBeenCalledWith(expect.stringContaining(text)); |
| 87 | +const errorMessages = runtime.error.mock.calls.map(([message]) => String(message)); |
| 88 | +expect(errorMessages.some((message) => message.includes(text))).toBe(true); |
87 | 89 | } |
88 | 90 | |
89 | 91 | // --- Tests --- |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。