diff --git a/test/e2e/bvg.js b/test/e2e/bvg.js index e8c4c957..818d593d 100644 --- a/test/e2e/bvg.js +++ b/test/e2e/bvg.js @@ -31,7 +31,6 @@ 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') -const testDeparturesWithoutRelatedStations = require('./lib/departures-without-related-stations') const testArrivals = require('./lib/arrivals') const testJourneysWithDetour = require('./lib/journeys-with-detour') const testReachableFrom = require('./lib/reachable-from') @@ -353,19 +352,6 @@ test('departures at 7-digit station', async (t) => { t.end() }) -// todo: `opt.includeRelatedStations` is currently not supported by BVG -test.skip('departures without related stations', async (t) => { - await testDeparturesWithoutRelatedStations({ - test: t, - fetchDepartures: client.departures, - id: '900000024101', // Charlottenburg - when, - products: {bus: false, suburban: false, regional: false}, - linesOfRelatedStations: ['U7'] - }) - t.end() -}) - test('arrivals', async (t) => { const arrivals = await client.arrivals(spichernstr, { duration: 5, when diff --git a/test/e2e/db.js b/test/e2e/db.js index 83a5dd01..7fa26447 100644 --- a/test/e2e/db.js +++ b/test/e2e/db.js @@ -22,7 +22,6 @@ 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') -const testDeparturesWithoutRelatedStations = require('./lib/departures-without-related-stations') const testArrivals = require('./lib/arrivals') const testJourneysWithDetour = require('./lib/journeys-with-detour') const testReachableFrom = require('./lib/reachable-from') @@ -321,20 +320,6 @@ test('departures at Berlin Hbf in direction of Berlin Ostbahnhof', async (t) => t.end() }) -test('departures without related stations', async (t) => { - await pStations - - await testDeparturesWithoutRelatedStations({ - test: t, - fetchDepartures: client.departures, - id: '8089051', // Berlin Yorckstr. (S1) - when, - products: {bus: false}, - linesOfRelatedStations: ['S 2', 'S 25', 'S 26', 'U 7'] - }) - t.end() -}) - test('arrivals at Berlin Schwedter Str.', async (t) => { await pStations diff --git a/test/e2e/lib/departures-without-related-stations.js b/test/e2e/lib/departures-without-related-stations.js deleted file mode 100644 index 9b21672b..00000000 --- a/test/e2e/lib/departures-without-related-stations.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict' - -const testDeparturesWithoutUnrelatedStations = async (cfg) => { - const { - test: t, - fetchDepartures, - id, - when - // duration, products - } = cfg - - const relatedLines = cfg.linesOfRelatedStations - .map(lName => lName.toLowerCase().trim()) - - const isUnrelatedLine = (dep) => { - if (!dep.line || !dep.line.name) return false - return relatedLines.includes(dep.line.name.toLowerCase().trim()) - } - - const depsWith = await fetchDepartures(id, { - when, - duration: cfg.duration || 20, - products: cfg.products || {} - }) - t.ok(depsWith.some(isUnrelatedLine), 'precondition failed: no line at related station found') - - const depsWithout = await fetchDepartures(id, { - includeRelatedStations: false, - when, - duration: cfg.duration || 20, - products: cfg.products || {} - }) - - const unrelatedDep = depsWithout.find(isUnrelatedLine) - if (unrelatedDep) t.fail('line at related station: ' + unrelatedDep.line.name) - else t.pass('no lines from related stations') -} - -module.exports = testDeparturesWithoutUnrelatedStations diff --git a/test/e2e/vbb.js b/test/e2e/vbb.js index 3c89808a..37da0f8d 100644 --- a/test/e2e/vbb.js +++ b/test/e2e/vbb.js @@ -22,7 +22,6 @@ 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') -const testDeparturesWithoutRelatedStations = require('./lib/departures-without-related-stations') const testArrivals = require('./lib/arrivals') const testJourneysWithDetour = require('./lib/journeys-with-detour') const testReachableFrom = require('./lib/reachable-from') @@ -296,18 +295,6 @@ test('departures at 7-digit station', async (t) => { t.end() }) -test('departures without related stations', async (t) => { - await testDeparturesWithoutRelatedStations({ - test: t, - fetchDepartures: client.departures, - id: '900000024101', // Charlottenburg - when, - products: {bus: false, suburban: false, regional: false}, - linesOfRelatedStations: ['U7'] - }) - t.end() -}) - test('arrivals', async (t) => { const arrivals = await client.arrivals(spichernstr, { duration: 5, when,