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 1 (no-changelog) (#14303)
This commit is contained in:
committed by
GitHub
parent
f85b851851
commit
73e8d76e13
@@ -1,5 +1,7 @@
|
||||
import nock from 'nock';
|
||||
|
||||
import { getWorkflowFilenames, testWorkflows } from '@test/nodes/Helpers';
|
||||
|
||||
import {
|
||||
getAlbum,
|
||||
getAlbumTracks,
|
||||
@@ -7,18 +9,9 @@ import {
|
||||
getNewReleases,
|
||||
searchForAlbum,
|
||||
} from './apiResponses';
|
||||
import {
|
||||
setup,
|
||||
equalityTest,
|
||||
workflowToTests,
|
||||
getWorkflowFilenames,
|
||||
} from '../../../../test/nodes/Helpers';
|
||||
|
||||
describe('Spotify', () => {
|
||||
describe('Run workflow', () => {
|
||||
const workflows = getWorkflowFilenames(__dirname);
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
const mock = nock('https://api.spotify.com/v1');
|
||||
mock
|
||||
@@ -31,10 +24,7 @@ describe('Spotify', () => {
|
||||
mock.get('/artists/12Chz98pHFMPJEknJQMWvI').reply(200, getArtist);
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
for (const testData of tests) {
|
||||
test(testData.description, async () => await equalityTest(testData, nodeTypes));
|
||||
}
|
||||
const workflows = getWorkflowFilenames(__dirname);
|
||||
testWorkflows(workflows);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user