Files
n8n-enterprise-unlocked/packages/nodes-base/nodes/ExecutionData/test/ExecutionData.node.test.ts
कारतोफ्फेलस्क्रिप्ट™ 73e8d76e13 refactor: Overhaul nodes-testing setup - Part 1 (no-changelog) (#14303)
2025-04-01 10:15:13 +02:00

25 lines
820 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));