test: guard message helper nullish deps · openclaw/openclaw@10c2a8a
steipete
·
2026-05-12
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -109,10 +109,12 @@ function expectMessageCommandOptions(expected: Record<string, unknown>, callInde
|
109 | 109 | for (const [key, expectedValue] of Object.entries(expected)) { |
110 | 110 | expect(options[key], `messageCommand options.${key}`).toEqual(expectedValue); |
111 | 111 | } |
112 | | -expect(call[1], "messageCommand runtime").not.toBeNull(); |
113 | | -expect(call[1], "messageCommand runtime").not.toBeUndefined(); |
114 | | -expect(call[2], "messageCommand deps").not.toBeNull(); |
115 | | -expect(call[2], "messageCommand deps").not.toBeUndefined(); |
| 112 | +if (call[1] == null) { |
| 113 | +throw new Error("expected messageCommand runtime"); |
| 114 | +} |
| 115 | +if (call[2] == null) { |
| 116 | +throw new Error("expected messageCommand deps"); |
| 117 | +} |
116 | 118 | } |
117 | 119 | |
118 | 120 | describe("runMessageAction", () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。