From 0582822fd4f13cf81a8e7577b3b7dca2105707b5 Mon Sep 17 00:00:00 2001 From: Marcin Gordel Date: Tue, 17 Oct 2023 14:22:31 +0200 Subject: [PATCH] test: fixed unit tests --- src/executor/executor.test.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/executor/executor.test.ts b/src/executor/executor.test.ts index c2fda39fe..d247338d3 100644 --- a/src/executor/executor.test.ts +++ b/src/executor/executor.test.ts @@ -24,6 +24,7 @@ jest.mock("../payment/service", () => { config: { payment: { network: "test" } }, createAllocation: jest.fn(), run: serviceRunSpy, + end: jest.fn(), }; }), }; @@ -42,6 +43,7 @@ describe("Task Executor", () => { const executor = await TaskExecutor.create({ package: "test", logger, yagnaOptions }); expect(serviceRunSpy).toHaveBeenCalledTimes(4); expect(executor).toBeDefined(); + await executor.end(); }); it("should handle a critical error if startup timeout is reached", async () => { const executor = await TaskExecutor.create({ package: "test", startupTimeout: 0, logger, yagnaOptions }); @@ -56,6 +58,7 @@ describe("Task Executor", () => { }); await sleep(10, true); expect(handleErrorSpy).toHaveBeenCalled(); + await executor.end(); }); }); });