mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
test(core): Unskip and fix workflow runner test (#16227)
This commit is contained in:
@@ -259,15 +259,15 @@ describe('run', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// eslint-disable-next-line n8n-local-rules/no-skipped-tests
|
describe('enqueueExecution', () => {
|
||||||
describe.skip('enqueueExecution', () => {
|
|
||||||
const setupQueue = jest.fn();
|
const setupQueue = jest.fn();
|
||||||
|
const addJob = jest.fn();
|
||||||
|
|
||||||
@Service()
|
@Service()
|
||||||
class MockScalingService {
|
class MockScalingService {
|
||||||
setupQueue = setupQueue;
|
setupQueue = setupQueue;
|
||||||
|
|
||||||
addJob = jest.fn();
|
addJob = addJob;
|
||||||
}
|
}
|
||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
@@ -288,9 +288,14 @@ describe.skip('enqueueExecution', () => {
|
|||||||
workflowData: { nodes: [] },
|
workflowData: { nodes: [] },
|
||||||
executionData: undefined,
|
executionData: undefined,
|
||||||
});
|
});
|
||||||
|
const error = new Error('stop for test purposes');
|
||||||
|
|
||||||
|
// mock a rejection to stop execution flow before we create the PCancelable promise,
|
||||||
|
// so that Jest does not move on to tear down the suite until the PCancelable settles
|
||||||
|
addJob.mockRejectedValueOnce(error);
|
||||||
|
|
||||||
// @ts-expect-error Private method
|
// @ts-expect-error Private method
|
||||||
await runner.enqueueExecution('1', data);
|
await expect(runner.enqueueExecution('1', data)).rejects.toThrowError(error);
|
||||||
|
|
||||||
expect(setupQueue).toHaveBeenCalledTimes(1);
|
expect(setupQueue).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user