mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
25 lines
777 B
TypeScript
25 lines
777 B
TypeScript
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
|
|
import { mock } from 'jest-mock-extended';
|
|
import type { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
|
|
|
|
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]);
|
|
});
|
|
});
|
|
|
|
describe('ExecutionData -> Should run the workflow', () => {
|
|
new NodeTestHarness().setupTests();
|
|
});
|