Skip to content

Commit

Permalink
test: fixed unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mgordel committed Oct 17, 2023
1 parent b7ff789 commit 0582822
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/executor/executor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jest.mock("../payment/service", () => {
config: { payment: { network: "test" } },
createAllocation: jest.fn(),
run: serviceRunSpy,
end: jest.fn(),
};
}),
};
Expand All @@ -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 });
Expand All @@ -56,6 +58,7 @@ describe("Task Executor", () => {
});
await sleep(10, true);
expect(handleErrorSpy).toHaveBeenCalled();
await executor.end();
});
});
});

0 comments on commit 0582822

Please sign in to comment.