Skip to content

Commit

Permalink
(fix): parse lat and lng closes #1
Browse files Browse the repository at this point in the history
  • Loading branch information
mpfeil committed Nov 19, 2019
1 parent e7ed36a commit dc99855
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down
6 changes: 6 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit dc99855

Please sign in to comment.