diff --git a/index.js b/index.js index ea6c2f0..8f61854 100644 --- a/index.js +++ b/index.js @@ -105,6 +105,8 @@ luqs.station = (kuerzel, options = {}) => { steckbrief.ende_messung ] = tmpSteckbrief steckbrief.image = `${messortBildUrl}${steckbrief.kuerzel.toUpperCase()}.jpg` + steckbrief.longitude = steckbrief.longitude.replace(',', '.') + steckbrief.latitude = steckbrief.latitude.replace(',', '.') resolve([steckbrief]) }) .catch(error => { diff --git a/test.js b/test.js index 66d4952..dcdad15 100644 --- a/test.js +++ b/test.js @@ -22,6 +22,12 @@ test('luqs.station() should reject with Error is to long', async t => { t.is(error.message, 'Kuerzel is to long') }) +test('luqs.station("unna") should return detailed information about a specific station', async t => { + const details = await luqs.station('unna') + t.truthy(Array.isArray(details)) + t.is(details[0].kuerzel, 'UNNA') +}) + test('luqs.aktuell() should resolve with array', async t => { const currentMeasurements = await luqs.aktuell() t.truthy(Array.isArray(currentMeasurements))