mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 03:12:15 +00:00
refactor: Overhaul nodes-testing setup - Part 1 (no-changelog) (#14303)
This commit is contained in:
committed by
GitHub
parent
f85b851851
commit
73e8d76e13
@@ -1,9 +1,8 @@
|
||||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import type { WorkflowTestData } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { setup, workflowToTests, getWorkflowFilenames } from '@test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '@test/nodes/types';
|
||||
import { workflowToTests, getWorkflowFilenames } from '@test/nodes/Helpers';
|
||||
|
||||
describe('Test N8n Node, expect base_url to be received from credentials', () => {
|
||||
const workflows = getWorkflowFilenames(__dirname);
|
||||
@@ -14,15 +13,14 @@ describe('Test N8n Node, expect base_url to be received from credentials', () =>
|
||||
const baseUrl = 'https://test.app.n8n.cloud/api/v1';
|
||||
nock(baseUrl).get('/workflows?tags=n8n-test').reply(200, {});
|
||||
});
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
const { result } = await executeWorkflow(testData, types);
|
||||
const testNode = async (testData: WorkflowTestData) => {
|
||||
const { result } = await executeWorkflow(testData);
|
||||
|
||||
expect(result.finished).toEqual(true);
|
||||
};
|
||||
|
||||
for (const testData of tests) {
|
||||
test(testData.description, async () => await testNode(testData, nodeTypes));
|
||||
test(testData.description, async () => await testNode(testData));
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user