Skip to content

Commit a1bfac2

Browse files
committed
feat: mock shared-runner for improved test isolation in main.test.ts
1 parent 6f7a024 commit a1bfac2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/engine/src/workers/main.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ import { ReleaseStaleJob } from "../internal-jobs/release-stale-jobs";
99
import { JobBuilder } from "../job/job-builder";
1010
import { runWorker, startCron } from "./main";
1111

12+
const runMock = vi.fn();
13+
14+
vi.mock("../shared-runner", () => ({
15+
RunnerPool: vi.fn().mockImplementation(() => ({
16+
run: runMock,
17+
})),
18+
}));
19+
1220
const cronMocks = vi.hoisted(() => ({
1321
schedule: vi.fn().mockReturnValue({ execute: vi.fn() }),
1422
}));

0 commit comments

Comments
 (0)