mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
add additional test case for already running timer
This commit is contained in:
@@ -59,6 +59,18 @@ describe("TimedApiBasedRepositoryLoader", () => {
|
|||||||
expect(setTimeout).toHaveBeenCalledWith(expect.any(Function), loader.timeout);
|
expect(setTimeout).toHaveBeenCalledWith(expect.any(Function), loader.timeout);
|
||||||
expect(loader.timeout).not.toBeUndefined();
|
expect(loader.timeout).not.toBeUndefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("does nothing if timer is already running", async () => {
|
||||||
|
await loader.start();
|
||||||
|
await loader.start();
|
||||||
|
|
||||||
|
Object.values(repositoryMock).forEach((mockFn) => {
|
||||||
|
expect(mockFn).toHaveBeenCalledTimes(1);
|
||||||
|
});
|
||||||
|
Object.values(spies).forEach((spy: any) => {
|
||||||
|
expect(spy).toHaveBeenCalledTimes(1);
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("stop", () => {
|
describe("stop", () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user