mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-09 03:47:29 -08:00
24 lines
827 B
TypeScript
24 lines
827 B
TypeScript
|
import { mock } from 'jest-mock-extended';
|
||
|
import type { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
|
||
|
|
||
|
import { testWorkflows, getWorkflowFilenames } from '../../../test/nodes/Helpers';
|
||
|
import { ExecutionData } from '../ExecutionData.node';
|
||
|
|
||
|
describe('ExecutionData Node', () => {
|
||
|
it('should return its input data', async () => {
|
||
|
const mockInputData: INodeExecutionData[] = [
|
||
|
{ json: { item: 0, foo: 'bar' } },
|
||
|
{ json: { item: 1, foo: 'quz' } },
|
||
|
];
|
||
|
const executeFns = mock<IExecuteFunctions>({
|
||
|
getInputData: () => mockInputData,
|
||
|
});
|
||
|
const result = await new ExecutionData().execute.call(executeFns);
|
||
|
|
||
|
expect(result).toEqual([mockInputData]);
|
||
|
});
|
||
|
});
|
||
|
|
||
|
const workflows = getWorkflowFilenames(__dirname);
|
||
|
describe('ExecutionData -> Should run the workflow', () => testWorkflows(workflows));
|