test: simplify loader duplicate counts · openclaw/openclaw@3c131c8
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -4177,7 +4177,7 @@ module.exports = { id: "throws-after-import", register() {} };`,
|
4177 | 4177 | api.registerHook("gateway:startup", () => {}, { name: "shared-hook" }); |
4178 | 4178 | } };`, |
4179 | 4179 | selectCount: (registry: ReturnType<typeof loadOpenClawPlugins>) => |
4180 | | -registry.hooks.filter((entry) => entry.entry.hook.name === "shared-hook").length, |
| 4180 | +countMatching(registry.hooks, (entry) => entry.entry.hook.name === "shared-hook"), |
4181 | 4181 | duplicateMessage: "hook already registered: shared-hook (hook-owner-a)", |
4182 | 4182 | assert: expectDuplicateRegistrationResult, |
4183 | 4183 | }, |
@@ -4189,7 +4189,7 @@ module.exports = { id: "throws-after-import", register() {} };`,
|
4189 | 4189 | api.registerService({ id: "shared-service", start() {} }); |
4190 | 4190 | } };`, |
4191 | 4191 | selectCount: (registry: ReturnType<typeof loadOpenClawPlugins>) => |
4192 | | -registry.services.filter((entry) => entry.service.id === "shared-service").length, |
| 4192 | +countMatching(registry.services, (entry) => entry.service.id === "shared-service"), |
4193 | 4193 | duplicateMessage: "service already registered: shared-service (service-owner-a)", |
4194 | 4194 | assert: expectDuplicateRegistrationResult, |
4195 | 4195 | }, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。