mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
refactor: Overhaul nodes-testing setup - Part 2 (no-changelog) (#14873)
This commit is contained in:
committed by
GitHub
parent
897338bd24
commit
91069f057e
@@ -1,6 +1,8 @@
|
||||
import nock from 'nock';
|
||||
|
||||
import { getWorkflowFilenames, initBinaryDataService, testWorkflows } from '@test/nodes/Helpers';
|
||||
import { getWorkflowFilenames, testWorkflows } from '@test/nodes/Helpers';
|
||||
|
||||
import { credentials } from '../../__tests__/credentials';
|
||||
|
||||
const workflows = getWorkflowFilenames(__dirname);
|
||||
|
||||
@@ -20,11 +22,10 @@ describe('Test AWS Comprehend Node', () => {
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
beforeAll(async () => {
|
||||
jest.useFakeTimers({ doNotFake: ['nextTick'], now });
|
||||
|
||||
await initBinaryDataService();
|
||||
|
||||
const baseUrl = 'https://comprehend.eu-central-1.amazonaws.com';
|
||||
|
||||
mock = nock(baseUrl);
|
||||
@@ -34,6 +35,6 @@ describe('Test AWS Comprehend Node', () => {
|
||||
mock.post('/').reply(200, response);
|
||||
});
|
||||
|
||||
testWorkflows(workflows);
|
||||
testWorkflows(workflows, credentials);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -2,6 +2,8 @@ import nock from 'nock';
|
||||
|
||||
import { getWorkflowFilenames, testWorkflows } from '@test/nodes/Helpers';
|
||||
|
||||
import { credentials } from '../../__tests__/credentials';
|
||||
|
||||
const responseLabels = [
|
||||
{
|
||||
LabelModelVersion: '3.0',
|
||||
@@ -298,6 +300,6 @@ describe('Test AWS Rekogntion Node', () => {
|
||||
mock.post('/').reply(200, responseLabels);
|
||||
});
|
||||
|
||||
testWorkflows(workflows);
|
||||
testWorkflows(workflows, credentials);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import nock from 'nock';
|
||||
|
||||
import { getWorkflowFilenames, initBinaryDataService, testWorkflows } from '@test/nodes/Helpers';
|
||||
import { getWorkflowFilenames, testWorkflows } from '@test/nodes/Helpers';
|
||||
|
||||
import { credentials } from '../../../__tests__/credentials';
|
||||
|
||||
const workflows = getWorkflowFilenames(__dirname);
|
||||
|
||||
@@ -12,8 +14,6 @@ describe('Test S3 V1 Node', () => {
|
||||
beforeAll(async () => {
|
||||
jest.useFakeTimers({ doNotFake: ['nextTick'], now });
|
||||
|
||||
await initBinaryDataService();
|
||||
|
||||
mock = nock('https://bucket.s3.eu-central-1.amazonaws.com');
|
||||
});
|
||||
|
||||
@@ -39,6 +39,6 @@ describe('Test S3 V1 Node', () => {
|
||||
.reply(200, { success: true });
|
||||
});
|
||||
|
||||
testWorkflows(workflows);
|
||||
testWorkflows(workflows, credentials);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import nock from 'nock';
|
||||
|
||||
import { getWorkflowFilenames, initBinaryDataService, testWorkflows } from '@test/nodes/Helpers';
|
||||
import { getWorkflowFilenames, testWorkflows } from '@test/nodes/Helpers';
|
||||
|
||||
import { credentials } from '../../../__tests__/credentials';
|
||||
|
||||
const workflows = getWorkflowFilenames(__dirname);
|
||||
|
||||
@@ -12,8 +14,6 @@ describe('Test S3 V2 Node', () => {
|
||||
beforeAll(async () => {
|
||||
jest.useFakeTimers({ doNotFake: ['nextTick'], now });
|
||||
|
||||
await initBinaryDataService();
|
||||
|
||||
mock = nock('https://s3.eu-central-1.amazonaws.com/buc.ket');
|
||||
});
|
||||
|
||||
@@ -39,6 +39,6 @@ describe('Test S3 V2 Node', () => {
|
||||
.reply(200, { success: true });
|
||||
});
|
||||
|
||||
testWorkflows(workflows);
|
||||
testWorkflows(workflows, credentials);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -5,6 +5,8 @@ import qs from 'node:querystring';
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import * as Helpers from '@test/nodes/Helpers';
|
||||
|
||||
import { credentials } from '../../__tests__/credentials';
|
||||
|
||||
describe('AwsSes Node', () => {
|
||||
const email = 'test+user@example.com';
|
||||
const templateData = {
|
||||
@@ -170,6 +172,7 @@ describe('AwsSes Node', () => {
|
||||
];
|
||||
|
||||
test.each(tests)('$description', async (testData) => {
|
||||
testData.credentials = credentials;
|
||||
const { result } = await executeWorkflow(testData);
|
||||
const resultNodeData = Helpers.getResultNodeData(result, testData);
|
||||
resultNodeData.forEach(({ nodeName, resultData }) =>
|
||||
|
||||
7
packages/nodes-base/nodes/Aws/__tests__/credentials.ts
Normal file
7
packages/nodes-base/nodes/Aws/__tests__/credentials.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export const credentials = {
|
||||
aws: {
|
||||
region: 'eu-central-1',
|
||||
accessKeyId: 'key',
|
||||
secretAccessKey: 'secret',
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user