fix build 💚

Apparently, ÖBB doesn't have info about the lines of a station.
This commit is contained in:
Jannis R 2018-01-26 17:40:14 +01:00
parent 5acd84b685
commit 031769b769
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5
3 changed files with 14 additions and 7 deletions

View file

@ -312,5 +312,10 @@ test('location', co(function* (t) {
assertValidStation(t, loc) assertValidStation(t, loc)
t.equal(loc.id, regensburgHbf) t.equal(loc.id, regensburgHbf)
t.ok(Array.isArray(loc.lines))
if (Array.isArray(loc.lines)) {
for (let line of loc.lines) assertValidLine(t, line)
}
t.end() t.end()
})) }))

View file

@ -6,9 +6,11 @@ const {DateTime} = require('luxon')
const isValidWGS84 = require('is-coordinates') const isValidWGS84 = require('is-coordinates')
const validateFptfWith = (t, item, allowedTypes, name) => { const validateFptfWith = (t, item, allowedTypes, name) => {
t.doesNotThrow(() => { try {
validateFptf.recurse(allowedTypes, item, name) validateFptf.recurse(allowedTypes, item, name)
}) } catch (err) {
t.ifError(err)
}
} }
const assertValidStation = (t, s, coordsOptional = false) => { const assertValidStation = (t, s, coordsOptional = false) => {
@ -18,11 +20,6 @@ const assertValidStation = (t, s, coordsOptional = false) => {
t.ok(s.location) t.ok(s.location)
assertValidLocation(t, s.location, coordsOptional) assertValidLocation(t, s.location, coordsOptional)
} }
if ('lines' in s) {
t.ok(Array.isArray(s.lines))
for (let l of s.lines) assertValidLine(t, l)
}
} }
const assertValidPoi = (t, p) => { const assertValidPoi = (t, p) => {

View file

@ -367,6 +367,11 @@ test('location', co(function* (t) {
assertValidStation(t, loc) assertValidStation(t, loc)
t.equal(loc.id, spichernstr) t.equal(loc.id, spichernstr)
t.ok(Array.isArray(loc.lines))
if (Array.isArray(loc.lines)) {
for (let line of loc.lines) assertValidLine(t, line)
}
t.end() t.end()
})) }))