mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 12:57:29 -08:00
✔️ Fix tests
This commit is contained in:
parent
9cb9ec2b93
commit
3f748e3aa8
|
@ -8,7 +8,9 @@ import {
|
||||||
INodeTypeData,
|
INodeTypeData,
|
||||||
IRun,
|
IRun,
|
||||||
ITaskData,
|
ITaskData,
|
||||||
|
IWorkflowBase,
|
||||||
IWorkflowExecuteAdditionalData,
|
IWorkflowExecuteAdditionalData,
|
||||||
|
WorkflowHooks,
|
||||||
} from 'n8n-workflow';
|
} from 'n8n-workflow';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
@ -248,20 +250,33 @@ export function NodeTypes(): NodeTypesClass {
|
||||||
|
|
||||||
|
|
||||||
export function WorkflowExecuteAdditionalData(waitPromise: IDeferredPromise<IRun>, nodeExecutionOrder: string[]): IWorkflowExecuteAdditionalData {
|
export function WorkflowExecuteAdditionalData(waitPromise: IDeferredPromise<IRun>, nodeExecutionOrder: string[]): IWorkflowExecuteAdditionalData {
|
||||||
|
const hookFunctions = {
|
||||||
|
nodeExecuteAfter: [
|
||||||
|
async (nodeName: string, data: ITaskData): Promise<void> => {
|
||||||
|
nodeExecutionOrder.push(nodeName);
|
||||||
|
},
|
||||||
|
],
|
||||||
|
workflowExecuteAfter: [
|
||||||
|
async (fullRunData: IRun): Promise<void> => {
|
||||||
|
waitPromise.resolve(fullRunData);
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
const workflowData: IWorkflowBase = {
|
||||||
|
name: '',
|
||||||
|
createdAt: new Date(),
|
||||||
|
updatedAt: new Date(),
|
||||||
|
active: true,
|
||||||
|
nodes: [],
|
||||||
|
connections: {},
|
||||||
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
credentials: {},
|
credentials: {},
|
||||||
hooks: {
|
hooks: new WorkflowHooks(hookFunctions, 'trigger', '1', workflowData),
|
||||||
nodeExecuteAfter: [
|
executeWorkflow: async (workflowId: string): Promise<any> => {}, // tslint:disable-line:no-any
|
||||||
async (nodeName: string, data: ITaskData): Promise<void> => {
|
restApiUrl: '',
|
||||||
nodeExecutionOrder.push(nodeName);
|
|
||||||
},
|
|
||||||
],
|
|
||||||
workflowExecuteAfter: [
|
|
||||||
async (fullRunData: IRun): Promise<void> => {
|
|
||||||
waitPromise.resolve(fullRunData);
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
encryptionKey: 'test',
|
encryptionKey: 'test',
|
||||||
timezone: 'America/New_York',
|
timezone: 'America/New_York',
|
||||||
webhookBaseUrl: 'webhook',
|
webhookBaseUrl: 'webhook',
|
||||||
|
|
Loading…
Reference in a new issue