refactor: Overhaul nodes-testing setup - Part 2 (no-changelog) (#14873)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2025-04-24 17:37:26 +02:00
committed by GitHub
parent 897338bd24
commit 91069f057e
119 changed files with 556 additions and 1002 deletions

View File

@@ -5,12 +5,19 @@ import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
import { workflowToTests, getWorkflowFilenames } from '@test/nodes/Helpers';
describe('Test N8n Node, expect base_url to be received from credentials', () => {
const credentials = {
n8nApi: {
apiKey: 'key123',
baseUrl: 'https://test.app.n8n.cloud/api/v1',
},
};
const workflows = getWorkflowFilenames(__dirname);
const tests = workflowToTests(workflows);
const tests = workflowToTests(workflows, credentials);
beforeAll(() => {
//base url is set in fake credentials map packages/nodes-base/test/nodes/FakeCredentialsMap.ts
const baseUrl = 'https://test.app.n8n.cloud/api/v1';
const { baseUrl } = credentials.n8nApi;
nock(baseUrl).get('/workflows?tags=n8n-test').reply(200, {});
});