mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 15:19:35 +02:00
fix build 💚
Apparently, ÖBB doesn't have info about the lines of a station.
This commit is contained in:
parent
5acd84b685
commit
031769b769
3 changed files with 14 additions and 7 deletions
|
@ -312,5 +312,10 @@ test('location', co(function* (t) {
|
|||
assertValidStation(t, loc)
|
||||
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()
|
||||
}))
|
||||
|
|
11
test/util.js
11
test/util.js
|
@ -6,9 +6,11 @@ const {DateTime} = require('luxon')
|
|||
const isValidWGS84 = require('is-coordinates')
|
||||
|
||||
const validateFptfWith = (t, item, allowedTypes, name) => {
|
||||
t.doesNotThrow(() => {
|
||||
try {
|
||||
validateFptf.recurse(allowedTypes, item, name)
|
||||
})
|
||||
} catch (err) {
|
||||
t.ifError(err)
|
||||
}
|
||||
}
|
||||
|
||||
const assertValidStation = (t, s, coordsOptional = false) => {
|
||||
|
@ -18,11 +20,6 @@ const assertValidStation = (t, s, coordsOptional = false) => {
|
|||
t.ok(s.location)
|
||||
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) => {
|
||||
|
|
|
@ -367,6 +367,11 @@ test('location', co(function* (t) {
|
|||
assertValidStation(t, loc)
|
||||
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()
|
||||
}))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue