mirror of
https://github.com/n8n-io/n8n.git
synced 2026-05-28 07:17:04 +02:00
21 lines
630 B
TypeScript
21 lines
630 B
TypeScript
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
|
|
import nock from 'nock';
|
|
|
|
import { currentWeatherResponse } from './apiResponses';
|
|
|
|
describe('OpenWeatherMap', () => {
|
|
describe('Run OpenWeatherMap workflow', () => {
|
|
beforeAll(() => {
|
|
nock('https://api.openweathermap.org')
|
|
.get('/data/2.5/weather')
|
|
.query({ units: 'metric', q: 'berlin,de', lang: 'en' })
|
|
.reply(200, currentWeatherResponse)
|
|
.get('/data/2.5/weather')
|
|
.query({ units: 'metric', q: 'invalid', lang: 'en' })
|
|
.reply(404, { cod: '404', message: 'city not found' });
|
|
});
|
|
|
|
new NodeTestHarness().setupTests();
|
|
});
|
|
});
|