fix: use find() instead of calls[0] in wakeGateway test to handle background fetch calls

This commit is contained in:
YeonGyu-Kim
2026-03-21 18:01:39 +09:00
parent 363661c0d6
commit eec268ee42

View File

@@ -40,7 +40,7 @@ describe("OpenClaw Dispatcher", () => {
expect(result.success).toBe(true)
expect(fetchSpy).toHaveBeenCalled()
const call = fetchSpy.mock.calls[0]
const call = fetchSpy.mock.calls.find(c => c[0] === "https://example.com")
expect(call[0]).toBe("https://example.com")
expect(call[1]?.method).toBe("POST")
expect(call[1]?.body).toBe('{"foo":"bar"}')