test: avoid cli count filter allocations

This commit is contained in:
Peter Steinberger
2026-05-08 21:54:43 +01:00
parent 016c8c9968
commit 9803a96adc
3 changed files with 8 additions and 4 deletions

View File

@@ -397,7 +397,9 @@ describe("registerPluginCliCommands", () => {
primary: "memory",
});
expect(program.commands.filter((command) => command.name() === "memory")).toHaveLength(1);
expect(
program.commands.reduce((count, command) => count + (command.name() === "memory" ? 1 : 0), 0),
).toBe(1);
expect(mocks.loadOpenClawPlugins).toHaveBeenCalledWith(
expect.objectContaining({
onlyPluginIds: ["memory-core"],