✔️ Fix tests

This commit is contained in:
Jan Oberhauser 2019-12-20 12:53:52 -06:00
parent 9cb9ec2b93
commit 3f748e3aa8

View file

@ -8,7 +8,9 @@ import {
INodeTypeData,
IRun,
ITaskData,
IWorkflowBase,
IWorkflowExecuteAdditionalData,
WorkflowHooks,
} from 'n8n-workflow';
import {
@ -248,9 +250,7 @@ export function NodeTypes(): NodeTypesClass {
export function WorkflowExecuteAdditionalData(waitPromise: IDeferredPromise<IRun>, nodeExecutionOrder: string[]): IWorkflowExecuteAdditionalData {
return {
credentials: {},
hooks: {
const hookFunctions = {
nodeExecuteAfter: [
async (nodeName: string, data: ITaskData): Promise<void> => {
nodeExecutionOrder.push(nodeName);
@ -261,7 +261,22 @@ export function WorkflowExecuteAdditionalData(waitPromise: IDeferredPromise<IRun
waitPromise.resolve(fullRunData);
},
],
},
};
const workflowData: IWorkflowBase = {
name: '',
createdAt: new Date(),
updatedAt: new Date(),
active: true,
nodes: [],
connections: {},
};
return {
credentials: {},
hooks: new WorkflowHooks(hookFunctions, 'trigger', '1', workflowData),
executeWorkflow: async (workflowId: string): Promise<any> => {}, // tslint:disable-line:no-any
restApiUrl: '',
encryptionKey: 'test',
timezone: 'America/New_York',
webhookBaseUrl: 'webhook',