mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 07:09:35 +02:00
INSA doesn't support refreshJourney 🐛
This commit is contained in:
parent
da10988b29
commit
067e807db7
4 changed files with 6 additions and 17 deletions
3
index.js
3
index.js
|
@ -458,9 +458,10 @@ const createClient = (profile, userAgent, request = _request) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const client = {departures, arrivals, journeys, refreshJourney, locations, station, nearby}
|
const client = {departures, arrivals, journeys, locations, station, nearby}
|
||||||
if (profile.trip) client.trip = trip
|
if (profile.trip) client.trip = trip
|
||||||
if (profile.radar) client.radar = radar
|
if (profile.radar) client.radar = radar
|
||||||
|
if (profile.refreshJourney) client.refreshJourney = refreshJourney
|
||||||
Object.defineProperty(client, 'profile', {value: profile})
|
Object.defineProperty(client, 'profile', {value: profile})
|
||||||
return client
|
return client
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,8 @@ const defaultProfile = {
|
||||||
|
|
||||||
journeysNumF: true, // `journeys()` method: support for `numF` field?
|
journeysNumF: true, // `journeys()` method: support for `numF` field?
|
||||||
trip: false,
|
trip: false,
|
||||||
radar: false
|
radar: false,
|
||||||
|
refreshJourney: true
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = defaultProfile
|
module.exports = defaultProfile
|
||||||
|
|
|
@ -26,7 +26,8 @@ const insaProfile = {
|
||||||
products: products,
|
products: products,
|
||||||
|
|
||||||
trip: true,
|
trip: true,
|
||||||
radar: true
|
radar: true,
|
||||||
|
refreshJourney: false
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = insaProfile;
|
module.exports = insaProfile;
|
||||||
|
|
14
test/insa.js
14
test/insa.js
|
@ -14,7 +14,6 @@ const testJourneysStationToStation = require('./lib/journeys-station-to-station'
|
||||||
const testJourneysStationToAddress = require('./lib/journeys-station-to-address')
|
const testJourneysStationToAddress = require('./lib/journeys-station-to-address')
|
||||||
const testJourneysStationToPoi = require('./lib/journeys-station-to-poi')
|
const testJourneysStationToPoi = require('./lib/journeys-station-to-poi')
|
||||||
const testEarlierLaterJourneys = require('./lib/earlier-later-journeys')
|
const testEarlierLaterJourneys = require('./lib/earlier-later-journeys')
|
||||||
const testRefreshJourney = require('./lib/refresh-journey')
|
|
||||||
const journeysFailsWithNoProduct = require('./lib/journeys-fails-with-no-product')
|
const journeysFailsWithNoProduct = require('./lib/journeys-fails-with-no-product')
|
||||||
const testDepartures = require('./lib/departures')
|
const testDepartures = require('./lib/departures')
|
||||||
const testDeparturesInDirection = require('./lib/departures-in-direction')
|
const testDeparturesInDirection = require('./lib/departures-in-direction')
|
||||||
|
@ -155,19 +154,6 @@ test('earlier/later journeys', co(function* (t) {
|
||||||
t.end()
|
t.end()
|
||||||
}))
|
}))
|
||||||
|
|
||||||
test('refreshJourney', co(function* (t) {
|
|
||||||
yield testRefreshJourney({
|
|
||||||
test: t,
|
|
||||||
fetchJourneys: client.journeys,
|
|
||||||
refreshJourney: client.refreshJourney,
|
|
||||||
validate,
|
|
||||||
fromId: magdeburgHbf,
|
|
||||||
toId: magdeburgBuckau,
|
|
||||||
when
|
|
||||||
})
|
|
||||||
t.end()
|
|
||||||
}))
|
|
||||||
|
|
||||||
test('trip details', co(function* (t) {
|
test('trip details', co(function* (t) {
|
||||||
const journeys = yield client.journeys(magdeburgHbf, magdeburgBuckau, {
|
const journeys = yield client.journeys(magdeburgHbf, magdeburgBuckau, {
|
||||||
results: 1, departure: when
|
results: 1, departure: when
|
||||||
|
|
Loading…
Add table
Reference in a new issue