expose only supported methods, fix test helpers 🐛

This commit is contained in:
Jannis R 2017-11-27 19:45:33 +01:00
parent ed0dfd06dd
commit 2e113d9520
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5
4 changed files with 14 additions and 5 deletions

View file

@ -225,7 +225,10 @@ const createClient = (profile) => {
})
}
return {departures, journeys, locations, nearby, journeyPart, radar}
const client = {departures, journeys, locations, nearby}
if (profile.journeyPart) client.journeyPart = journeyPart
if (profile.radar) client.radar = radar
return client
}
module.exports = createClient

View file

@ -54,7 +54,10 @@ const defaultProfile = {
formatStation,
formatTime,
formatLocation,
formatRectangle
formatRectangle,
journeyPart: false,
radar: false
}
module.exports = defaultProfile

View file

@ -86,7 +86,10 @@ const vbbProfile = {
parseProducts: createParseBitmask(modes.bitmasks),
formatStation,
formatProducts
formatProducts,
journeyPart: true,
radar: true
}
module.exports = vbbProfile

View file

@ -26,7 +26,7 @@ const assertValidPoi = (t, p) => {
t.equal(typeof p.name, 'string')
t.ok(p.coordinates)
if (s.coordinates) {
if (p.coordinates) {
t.equal(typeof p.coordinates.latitude, 'number')
t.equal(typeof p.coordinates.longitude, 'number')
}
@ -38,7 +38,7 @@ const assertValidAddress = (t, a) => {
t.equal(typeof a.name, 'string')
t.ok(a.coordinates)
if (s.coordinates) {
if (a.coordinates) {
t.equal(typeof a.coordinates.latitude, 'number')
t.equal(typeof a.coordinates.longitude, 'number')
}