mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-05 09:57:27 -08:00
f258cebe53
Some checks are pending
Test Master / install-and-build (push) Waiting to run
Test Master / Unit tests (18.x) (push) Blocked by required conditions
Test Master / Unit tests (20.x) (push) Blocked by required conditions
Test Master / Unit tests (22.4) (push) Blocked by required conditions
Test Master / Lint (push) Blocked by required conditions
Test Master / Notify Slack on failure (push) Blocked by required conditions
Benchmark Docker Image CI / build (push) Waiting to run
32 lines
806 B
TypeScript
32 lines
806 B
TypeScript
import nock from 'nock';
|
|
|
|
import { setup, equalityTest, workflowToTests, getWorkflowFilenames } from '@test/nodes/Helpers';
|
|
|
|
import { currentWeatherResponse } from './apiResponses';
|
|
|
|
describe('OpenWeatherMap', () => {
|
|
describe('Run OpenWeatherMap workflow', () => {
|
|
const workflows = getWorkflowFilenames(__dirname);
|
|
const tests = workflowToTests(workflows);
|
|
|
|
beforeAll(() => {
|
|
nock.disableNetConnect();
|
|
|
|
nock('https://api.openweathermap.org')
|
|
.get('/data/2.5/weather')
|
|
.query({ units: 'metric', q: 'berlin,de', lang: 'en' })
|
|
.reply(200, currentWeatherResponse);
|
|
});
|
|
|
|
afterAll(() => {
|
|
nock.restore();
|
|
});
|
|
|
|
const nodeTypes = setup(tests);
|
|
|
|
for (const testData of tests) {
|
|
test(testData.description, async () => await equalityTest(testData, nodeTypes));
|
|
}
|
|
});
|
|
});
|