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

44 lines
1.1 KiB
TypeScript

import type { WorkflowTestData } from 'n8n-workflow';
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
describe('Execute Start Node', () => {
const tests: WorkflowTestData[] = [
{
description: 'should run start node',
input: {
workflowData: {
nodes: [
{
id: 'uuid-1',
parameters: {},
name: 'Start',
type: 'n8n-nodes-base.start',
typeVersion: 1,
position: [100, 300],
},
],
connections: {},
},
},
output: {
nodeExecutionOrder: ['Start'],
nodeData: {},
},
},
];
for (const testData of tests) {
test(testData.description, async () => {
// execute workflow
const { result, nodeExecutionOrder } = await executeWorkflow(testData);
// Check if the nodes did execute in the correct order
expect(nodeExecutionOrder).toEqual(testData.output.nodeExecutionOrder);
// Check if other data has correct value
expect(result.finished).toEqual(true);
expect(result.data.executionData!.contextData).toEqual({});
expect(result.data.executionData!.nodeExecutionStack).toEqual([]);
});
}
});