mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-15 17:14:05 -08:00
20 lines
637 B
TypeScript
20 lines
637 B
TypeScript
import { mock } from 'jest-mock-extended';
|
|
import type { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
|
|
|
|
import { ExecuteWorkflowTrigger } from '../ExecuteWorkflowTrigger.node';
|
|
|
|
describe('ExecuteWorkflowTrigger', () => {
|
|
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 ExecuteWorkflowTrigger().execute.call(executeFns);
|
|
|
|
expect(result).toEqual([mockInputData]);
|
|
});
|
|
});
|