✔️ 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, 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',