refactor(core): Simplify createDeferredPromise, and add tests (no-changelog) (#10811)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-09-13 15:53:03 +02:00
committed by GitHub
parent d647ef41ac
commit cef64329a9
14 changed files with 66 additions and 43 deletions

View File

@@ -30,7 +30,7 @@ describe('WorkflowExecute', () => {
},
});
const waitPromise = await createDeferredPromise<IRun>();
const waitPromise = createDeferredPromise<IRun>();
const nodeExecutionOrder: string[] = [];
const additionalData = Helpers.WorkflowExecuteAdditionalData(
waitPromise,
@@ -41,7 +41,7 @@ describe('WorkflowExecute', () => {
const executionData = await workflowExecute.run(workflowInstance);
const result = await waitPromise.promise();
const result = await waitPromise.promise;
// Check if the data from WorkflowExecute is identical to data received
// by the webhooks
@@ -93,7 +93,7 @@ describe('WorkflowExecute', () => {
},
});
const waitPromise = await createDeferredPromise<IRun>();
const waitPromise = createDeferredPromise<IRun>();
const nodeExecutionOrder: string[] = [];
const additionalData = Helpers.WorkflowExecuteAdditionalData(
waitPromise,
@@ -104,7 +104,7 @@ describe('WorkflowExecute', () => {
const executionData = await workflowExecute.run(workflowInstance);
const result = await waitPromise.promise();
const result = await waitPromise.promise;
// Check if the data from WorkflowExecute is identical to data received
// by the webhooks
@@ -160,7 +160,7 @@ describe('WorkflowExecute', () => {
settings: testData.input.workflowData.settings,
});
const waitPromise = await createDeferredPromise<IRun>();
const waitPromise = createDeferredPromise<IRun>();
const nodeExecutionOrder: string[] = [];
const additionalData = Helpers.WorkflowExecuteAdditionalData(
waitPromise,
@@ -171,7 +171,7 @@ describe('WorkflowExecute', () => {
const executionData = await workflowExecute.run(workflowInstance);
const result = await waitPromise.promise();
const result = await waitPromise.promise;
// Check if the data from WorkflowExecute is identical to data received
// by the webhooks