Skip to content

Commit

Permalink
test(Cron): Add workflow test to Cron node
Browse files Browse the repository at this point in the history
  • Loading branch information
dana-gill committed Dec 27, 2024
1 parent 983e87a commit 0023f67
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/nodes-base/nodes/Cron/test/Cron.node.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { equalityTest, getWorkflowFilenames, setup, workflowToTests } from '@test/nodes/Helpers';

describe('Cron Node', () => {
const workflows = getWorkflowFilenames(__dirname);
const workflowTests = workflowToTests(workflows);

afterAll(() => {
jest.resetAllMocks();
});

const nodeTypes = setup(workflowTests);

for (const workflow of workflowTests) {
test(workflow.description, async () => await equalityTest(workflow, nodeTypes));
}
});
23 changes: 23 additions & 0 deletions packages/nodes-base/nodes/Cron/test/workflow.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"nodes": [
{
"parameters": {
"rule": {
"interval": [
{
"field": "seconds",
"secondsInterval": 1
}
]
}
},
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1.2,
"position": [0, 0],
"id": "d6fdb767-e4f9-439c-8faf-e44620e94fb0",
"name": "Schedule Trigger"
}
],
"connections": {},
"pinData": {}
}

0 comments on commit 0023f67

Please sign in to comment.