test: simplify matrix room state count · openclaw/openclaw@5104fd0
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
File tree
extensions/matrix/src/matrix/monitor
| Original file line number | Diff line number | Diff line change |
|---|
@@ -46,7 +46,13 @@ function createMissingMetadataError() {
|
46 | 46 | } |
47 | 47 | |
48 | 48 | function getRoomStateCallCount(client: RoomInfoClientStub, eventType: string) { |
49 | | -return client.getRoomStateEvent.mock.calls.filter(([, type]) => type === eventType).length; |
| 49 | +let count = 0; |
| 50 | +for (const [, type] of client.getRoomStateEvent.mock.calls) { |
| 51 | +if (type === eventType) { |
| 52 | +count++; |
| 53 | +} |
| 54 | +} |
| 55 | +return count; |
50 | 56 | } |
51 | 57 | |
52 | 58 | describe("createMatrixRoomInfoResolver", () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。