mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
refactor: Async functions don't need to explicitly return promises (no-changelog) (#6041)
This commit is contained in:
committed by
GitHub
parent
03be725cef
commit
308a94311f
@@ -99,12 +99,11 @@ jest.mock('@/Db', () => {
|
||||
return {
|
||||
collections: {
|
||||
Workflow: {
|
||||
find: jest.fn(async () => Promise.resolve(generateWorkflows(databaseActiveWorkflowsCount))),
|
||||
find: jest.fn(async () => generateWorkflows(databaseActiveWorkflowsCount)),
|
||||
findOne: jest.fn(async (searchParams) => {
|
||||
const foundWorkflow = databaseActiveWorkflowsList.find(
|
||||
return databaseActiveWorkflowsList.find(
|
||||
(workflow) => workflow.id.toString() === searchParams.where.id.toString(),
|
||||
);
|
||||
return Promise.resolve(foundWorkflow);
|
||||
}),
|
||||
update: jest.fn(),
|
||||
createQueryBuilder: jest.fn(() => {
|
||||
@@ -112,7 +111,7 @@ jest.mock('@/Db', () => {
|
||||
update: () => fakeQueryBuilder,
|
||||
set: () => fakeQueryBuilder,
|
||||
where: () => fakeQueryBuilder,
|
||||
execute: () => Promise.resolve(),
|
||||
execute: async () => {},
|
||||
};
|
||||
return fakeQueryBuilder;
|
||||
}),
|
||||
@@ -246,7 +245,7 @@ describe('ActiveWorkflowRunner', () => {
|
||||
const workflow = generateWorkflows(1);
|
||||
const additionalData = await WorkflowExecuteAdditionalData.getBase('fake-user-id');
|
||||
|
||||
workflowRunnerRun.mockImplementationOnce(() => Promise.resolve('invalid-execution-id'));
|
||||
workflowRunnerRun.mockResolvedValueOnce('invalid-execution-id');
|
||||
|
||||
await activeWorkflowRunner.runWorkflow(
|
||||
workflow[0],
|
||||
|
||||
Reference in New Issue
Block a user