




















@@ -13,6 +13,14 @@ vi.mock("openclaw/plugin-sdk/text-utility-runtime", () => ({
1313withTimeout: withTimeoutMock,
1414}));
151516+function requireFirstTimeoutCall() {
17+const [call] = withTimeoutMock.mock.calls;
18+if (!call) {
19+throw new Error("expected withTimeout call");
20+}
21+return call;
22+}
23+1624describe("probeSlack", () => {
1725beforeEach(() => {
1826authTestMock.mockReset();
@@ -46,8 +54,9 @@ describe("probeSlack", () => {
4654});
4755expect(createSlackWebClientMock).toHaveBeenCalledWith("xoxb-test");
4856expect(withTimeoutMock).toHaveBeenCalledTimes(1);
49-expect(withTimeoutMock.mock.calls[0]?.[0]).toBeInstanceOf(Promise);
50-expect(withTimeoutMock.mock.calls[0]?.[1]).toBe(2500);
57+const [promise, timeoutMs] = requireFirstTimeoutCall();
58+expect(promise).toBeInstanceOf(Promise);
59+expect(timeoutMs).toBe(2500);
5160});
52615362it("keeps optional auth metadata fields undefined when Slack omits them", async () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。