mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-15 02:30:46 +00:00
test: avoid misc count filter allocations
This commit is contained in:
@@ -582,7 +582,12 @@ describe("runCli exit behavior", () => {
|
||||
try {
|
||||
const runPromise = runCli(["node", "openclaw", "plugins", "marketplace", "list"]);
|
||||
await vi.waitFor(() => {
|
||||
expect(processOnceSpy.mock.calls.filter(([event]) => event === "exit")).toHaveLength(2);
|
||||
expect(
|
||||
processOnceSpy.mock.calls.reduce(
|
||||
(count, [event]) => count + (event === "exit" ? 1 : 0),
|
||||
0,
|
||||
),
|
||||
).toBe(2);
|
||||
});
|
||||
|
||||
const exitHandler = processOnceSpy.mock.calls.find(([event]) => event === "exit")?.[1];
|
||||
|
||||
Reference in New Issue
Block a user