mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-02 07:01:30 -08:00
fix WaitTracker tests
This commit is contained in:
parent
d407726da4
commit
40c17af7ab
|
@ -14,7 +14,7 @@ import { WaitTracker } from '@/wait-tracker';
|
||||||
import type { WorkflowRunner } from '@/workflow-runner';
|
import type { WorkflowRunner } from '@/workflow-runner';
|
||||||
import { mockLogger } from '@test/mocking';
|
import { mockLogger } from '@test/mocking';
|
||||||
|
|
||||||
jest.useFakeTimers();
|
jest.useFakeTimers({ advanceTimers: true });
|
||||||
|
|
||||||
describe('WaitTracker', () => {
|
describe('WaitTracker', () => {
|
||||||
const activeExecutions = mock<ActiveExecutions>();
|
const activeExecutions = mock<ActiveExecutions>();
|
||||||
|
@ -190,21 +190,21 @@ describe('WaitTracker', () => {
|
||||||
);
|
);
|
||||||
|
|
||||||
postExecutePromise.resolve(mock<IRun>());
|
postExecutePromise.resolve(mock<IRun>());
|
||||||
jest.runAllTicks();
|
await jest.advanceTimersByTimeAsync(100);
|
||||||
|
|
||||||
expect(workflowRunner.run).toHaveBeenCalledTimes(2);
|
expect(workflowRunner.run).toHaveBeenCalledTimes(2);
|
||||||
expect(workflowRunner.run).toHaveBeenNthCalledWith(
|
expect(workflowRunner.run).toHaveBeenNthCalledWith(
|
||||||
2,
|
2,
|
||||||
{
|
{
|
||||||
executionMode: execution.mode,
|
executionMode: parentExecution.mode,
|
||||||
executionData: execution.data,
|
executionData: parentExecution.data,
|
||||||
workflowData: execution.workflowData,
|
workflowData: parentExecution.workflowData,
|
||||||
projectId: project.id,
|
projectId: project.id,
|
||||||
pushRef: execution.data.pushRef,
|
pushRef: parentExecution.data.pushRef,
|
||||||
},
|
},
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
execution.id,
|
parentExecution.id,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue