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,5 @@
|
||||
import nock from 'nock';
|
||||
|
||||
import { FAKE_CREDENTIALS_DATA } from '@test/nodes/FakeCredentialsMap';
|
||||
import { getWorkflowFilenames, testWorkflows } from '@test/nodes/Helpers';
|
||||
|
||||
import {
|
||||
@@ -18,10 +17,16 @@ import {
|
||||
} from './apiResponses';
|
||||
|
||||
describe('Telegram', () => {
|
||||
const credentials = {
|
||||
telegramApi: {
|
||||
accessToken: 'testToken',
|
||||
baseUrl: 'https://api.telegram.org',
|
||||
},
|
||||
};
|
||||
|
||||
describe('Run Telegram workflow', () => {
|
||||
beforeAll(() => {
|
||||
const { baseUrl } = FAKE_CREDENTIALS_DATA.telegramApi;
|
||||
const mock = nock(baseUrl);
|
||||
const mock = nock(credentials.telegramApi.baseUrl);
|
||||
|
||||
mock.post('/bottestToken/getChat').reply(200, getChatResponse);
|
||||
mock.post('/bottestToken/sendMessage').reply(200, sendMessageResponse);
|
||||
@@ -43,6 +48,6 @@ describe('Telegram', () => {
|
||||
});
|
||||
|
||||
const workflows = getWorkflowFilenames(__dirname);
|
||||
testWorkflows(workflows);
|
||||
testWorkflows(workflows, credentials);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user