1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Make test more strict

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
Janne Savolainen 2022-05-18 08:43:02 +03:00
parent df4e65d4b3
commit aa32655cbe
No known key found for this signature in database
GPG Key ID: 8C6CFB2FFFE8F68A
2 changed files with 13 additions and 7 deletions

View File

@ -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<void>>;
let runMock: AsyncFnMock<(...args: unknown[]) => Promise<void>>;
let actualPromise: Promise<void>;
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 () => {

View File

@ -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"],
]);
});
});