diff --git a/src/common/runnable/run-many-for.test.ts b/src/common/runnable/run-many-for.test.ts index 997b913b25..e281c6cb44 100644 --- a/src/common/runnable/run-many-for.test.ts +++ b/src/common/runnable/run-many-for.test.ts @@ -17,7 +17,7 @@ import { getPromiseStatus } from "../test-utils/get-promise-status"; describe("runManyFor", () => { describe("given no hierarchy, when running many", () => { - let runMock: AsyncFnMock<() => Promise>; + let runMock: AsyncFnMock<(...args: unknown[]) => Promise>; let actualPromise: Promise; beforeEach(() => { @@ -31,13 +31,13 @@ describe("runManyFor", () => { const someInjectable = getInjectable({ id: "some-injectable", - instantiate: () => ({ run: runMock }), + instantiate: () => ({ run: () => runMock("some-call") }), injectionToken: someInjectionTokenForRunnables, }); const someOtherInjectable = getInjectable({ id: "some-other-injectable", - instantiate: () => ({ run: runMock }), + instantiate: () => ({ run: () => runMock("some-other-call") }), injectionToken: someInjectionTokenForRunnables, }); @@ -49,7 +49,10 @@ describe("runManyFor", () => { }); it("runs all runnables at the same time", () => { - expect(runMock).toHaveBeenCalledTimes(2); + expect(runMock.mock.calls).toEqual([ + ["some-call"], + ["some-other-call"], + ]); }); it("does not resolve yet", async () => { diff --git a/src/common/runnable/run-many-sync-for.test.ts b/src/common/runnable/run-many-sync-for.test.ts index f115c33265..4e28362724 100644 --- a/src/common/runnable/run-many-sync-for.test.ts +++ b/src/common/runnable/run-many-sync-for.test.ts @@ -27,13 +27,13 @@ describe("runManySyncFor", () => { const someInjectable = getInjectable({ id: "some-injectable", - instantiate: () => ({ run: runMock }), + instantiate: () => ({ run: () => runMock("some-call") }), injectionToken: someInjectionTokenForRunnables, }); const someOtherInjectable = getInjectable({ id: "some-other-injectable", - instantiate: () => ({ run: runMock }), + instantiate: () => ({ run: () => runMock("some-other-call") }), injectionToken: someInjectionTokenForRunnables, }); @@ -45,7 +45,10 @@ describe("runManySyncFor", () => { }); it("runs all runnables at the same time", () => { - expect(runMock).toHaveBeenCalledTimes(2); + expect(runMock.mock.calls).toEqual([ + ["some-call"], + ["some-other-call"], + ]); }); });