fix WaitTracker tests

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2024-12-02 14:43:46 +01:00
parent d407726da4
commit 40c17af7ab
No known key found for this signature in database

View file

@ -14,7 +14,7 @@ import { WaitTracker } from '@/wait-tracker';
import type { WorkflowRunner } from '@/workflow-runner';
import { mockLogger } from '@test/mocking';
jest.useFakeTimers();
jest.useFakeTimers({ advanceTimers: true });
describe('WaitTracker', () => {
const activeExecutions = mock<ActiveExecutions>();
@ -190,21 +190,21 @@ describe('WaitTracker', () => {
);
postExecutePromise.resolve(mock<IRun>());
jest.runAllTicks();
await jest.advanceTimersByTimeAsync(100);
expect(workflowRunner.run).toHaveBeenCalledTimes(2);
expect(workflowRunner.run).toHaveBeenNthCalledWith(
2,
{
executionMode: execution.mode,
executionData: execution.data,
workflowData: execution.workflowData,
executionMode: parentExecution.mode,
executionData: parentExecution.data,
workflowData: parentExecution.workflowData,
projectId: project.id,
pushRef: execution.data.pushRef,
pushRef: parentExecution.data.pushRef,
},
false,
false,
execution.id,
parentExecution.id,
);
});
});