mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 07:09:35 +02:00
expose only supported methods, fix test helpers 🐛
This commit is contained in:
parent
ed0dfd06dd
commit
2e113d9520
4 changed files with 14 additions and 5 deletions
5
index.js
5
index.js
|
@ -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
|
module.exports = createClient
|
||||||
|
|
|
@ -54,7 +54,10 @@ const defaultProfile = {
|
||||||
formatStation,
|
formatStation,
|
||||||
formatTime,
|
formatTime,
|
||||||
formatLocation,
|
formatLocation,
|
||||||
formatRectangle
|
formatRectangle,
|
||||||
|
|
||||||
|
journeyPart: false,
|
||||||
|
radar: false
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = defaultProfile
|
module.exports = defaultProfile
|
||||||
|
|
|
@ -86,7 +86,10 @@ const vbbProfile = {
|
||||||
parseProducts: createParseBitmask(modes.bitmasks),
|
parseProducts: createParseBitmask(modes.bitmasks),
|
||||||
|
|
||||||
formatStation,
|
formatStation,
|
||||||
formatProducts
|
formatProducts,
|
||||||
|
|
||||||
|
journeyPart: true,
|
||||||
|
radar: true
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = vbbProfile
|
module.exports = vbbProfile
|
||||||
|
|
|
@ -26,7 +26,7 @@ const assertValidPoi = (t, p) => {
|
||||||
|
|
||||||
t.equal(typeof p.name, 'string')
|
t.equal(typeof p.name, 'string')
|
||||||
t.ok(p.coordinates)
|
t.ok(p.coordinates)
|
||||||
if (s.coordinates) {
|
if (p.coordinates) {
|
||||||
t.equal(typeof p.coordinates.latitude, 'number')
|
t.equal(typeof p.coordinates.latitude, 'number')
|
||||||
t.equal(typeof p.coordinates.longitude, 'number')
|
t.equal(typeof p.coordinates.longitude, 'number')
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ const assertValidAddress = (t, a) => {
|
||||||
|
|
||||||
t.equal(typeof a.name, 'string')
|
t.equal(typeof a.name, 'string')
|
||||||
t.ok(a.coordinates)
|
t.ok(a.coordinates)
|
||||||
if (s.coordinates) {
|
if (a.coordinates) {
|
||||||
t.equal(typeof a.coordinates.latitude, 'number')
|
t.equal(typeof a.coordinates.latitude, 'number')
|
||||||
t.equal(typeof a.coordinates.longitude, 'number')
|
t.equal(typeof a.coordinates.longitude, 'number')
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue