test: tighten native bridge cleanup assertion · openclaw/openclaw@0056f84
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -148,9 +148,10 @@ describe("initNativeBridge", () => {
|
148 | 148 | const host = makeHost(); |
149 | 149 | const cleanup = initNativeBridge(host); |
150 | 150 | expect(bridge.listeners).toHaveLength(1); |
| 151 | +const registeredListener = bridge.listeners[0]; |
151 | 152 | cleanup(); |
152 | 153 | expect(bridge.listeners).toHaveLength(0); |
153 | | -expect(bridge.removeEventListener).toHaveBeenCalledWith("message", expect.any(Function)); |
| 154 | +expect(bridge.removeEventListener).toHaveBeenCalledWith("message", registeredListener); |
154 | 155 | }); |
155 | 156 | |
156 | 157 | it("does not call handleChatDraftChange after cleanup", () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。