diff --git a/index.js b/index.js index 54235449..86adec98 100644 --- a/index.js +++ b/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.radar) client.radar = radar + if (profile.refreshJourney) client.refreshJourney = refreshJourney Object.defineProperty(client, 'profile', {value: profile}) return client } diff --git a/lib/default-profile.js b/lib/default-profile.js index c7c0f89b..1ed38de5 100644 --- a/lib/default-profile.js +++ b/lib/default-profile.js @@ -67,7 +67,8 @@ const defaultProfile = { journeysNumF: true, // `journeys()` method: support for `numF` field? trip: false, - radar: false + radar: false, + refreshJourney: true } module.exports = defaultProfile diff --git a/p/insa/index.js b/p/insa/index.js index c02b3445..bfd6b5b1 100644 --- a/p/insa/index.js +++ b/p/insa/index.js @@ -26,7 +26,8 @@ const insaProfile = { products: products, trip: true, - radar: true + radar: true, + refreshJourney: false } module.exports = insaProfile; diff --git a/test/insa.js b/test/insa.js index cca2762b..90aee588 100644 --- a/test/insa.js +++ b/test/insa.js @@ -14,7 +14,6 @@ const testJourneysStationToStation = require('./lib/journeys-station-to-station' const testJourneysStationToAddress = require('./lib/journeys-station-to-address') const testJourneysStationToPoi = require('./lib/journeys-station-to-poi') const testEarlierLaterJourneys = require('./lib/earlier-later-journeys') -const testRefreshJourney = require('./lib/refresh-journey') const journeysFailsWithNoProduct = require('./lib/journeys-fails-with-no-product') const testDepartures = require('./lib/departures') const testDeparturesInDirection = require('./lib/departures-in-direction') @@ -155,19 +154,6 @@ test('earlier/later journeys', co(function* (t) { 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) { const journeys = yield client.journeys(magdeburgHbf, magdeburgBuckau, { results: 1, departure: when