From 8566bcc85f70f5889dd1e12e8da436195a8050b5 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Fri, 1 Feb 2019 15:35:18 +0100 Subject: [PATCH] journeys tests: expect 4 results :white_check_mark: The default nr of results returned by HAFAS seems to be `3`, so we pick a different one to assert that the `results` option actually works. --- test/bvg.js | 2 +- test/cmta.js | 2 +- test/db.js | 2 +- test/insa.js | 2 +- test/lib/journeys-station-to-station.js | 2 +- test/nahsh.js | 2 +- test/oebb.js | 2 +- test/sbahn-muenchen.js | 2 +- test/vbb.js | 2 +- test/vbn.js | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test/bvg.js b/test/bvg.js index 75598244..1813c62f 100644 --- a/test/bvg.js +++ b/test/bvg.js @@ -67,7 +67,7 @@ const hour = 60 * 60 * 1000 test('journeys – Spichernstr. to Bismarckstr.', async (t) => { const res = await client.journeys(spichernstr, bismarckstr, { - results: 3, + results: 4, departure: when, stopovers: true }) diff --git a/test/cmta.js b/test/cmta.js index f0081f68..2087262c 100644 --- a/test/cmta.js +++ b/test/cmta.js @@ -43,7 +43,7 @@ const capitol591 = '591' test('journeys – Broadie Oaks to Domain', async (t) => { const res = await client.journeys(broadieOaks, domain, { - results: 3, + results: 4, departure: when, stopovers: true }) diff --git a/test/db.js b/test/db.js index 21d8d532..fb917082 100644 --- a/test/db.js +++ b/test/db.js @@ -89,7 +89,7 @@ const potsdamHbf = '8012666' test('journeys – Berlin Schwedter Str. to München Hbf', async (t) => { const res = await client.journeys(blnSchwedterStr, münchenHbf, { - results: 3, + results: 4, departure: when, stopovers: true }) diff --git a/test/insa.js b/test/insa.js index ed3a0106..42d78697 100644 --- a/test/insa.js +++ b/test/insa.js @@ -48,7 +48,7 @@ const universitaet = '19686' test('journeys – Magdeburg Hbf to Magdeburg-Buckau', async (t) => { const res = await client.journeys(magdeburgHbf, magdeburgBuckau, { - results: 3, + results: 4, departure: when, stopovers: true }) diff --git a/test/lib/journeys-station-to-station.js b/test/lib/journeys-station-to-station.js index 4c5402fa..b6abea66 100644 --- a/test/lib/journeys-station-to-station.js +++ b/test/lib/journeys-station-to-station.js @@ -6,7 +6,7 @@ const testJourneysStationToStation = async (cfg) => { validate(t, res, 'journeysResult', 'res') const {journeys} = res - t.strictEqual(journeys.length, 3) + t.strictEqual(journeys.length, 4) for (let i = 0; i < journeys.length; i++) { const j = journeys[i] diff --git a/test/nahsh.js b/test/nahsh.js index 7b5b2e70..1251b2f2 100644 --- a/test/nahsh.js +++ b/test/nahsh.js @@ -77,7 +77,7 @@ const kielRaeucherei = '9049217' test('journeys – Kiel Hbf to Flensburg', async (t) => { const res = await client.journeys(kielHbf, flensburg, { - results: 3, + results: 4, departure: when, stopovers: true }) diff --git a/test/oebb.js b/test/oebb.js index 2d98b75e..c90c948e 100644 --- a/test/oebb.js +++ b/test/oebb.js @@ -68,7 +68,7 @@ const wienPilgramgasse = '1390562' test.skip('journeys – Salzburg Hbf to Wien Westbahnhof', async (t) => { const res = await client.journeys(salzburgHbf, wienFickeystr, { - results: 3, + results: 4, departure: when, stopovers: true }) diff --git a/test/sbahn-muenchen.js b/test/sbahn-muenchen.js index 8a581429..4d964e6d 100644 --- a/test/sbahn-muenchen.js +++ b/test/sbahn-muenchen.js @@ -64,7 +64,7 @@ const poetschnerstr = { test('journeys – Mittersendling to Karl-Theodor-Straße', async (t) => { const res = await client.journeys(mittersendling, karlTheodorStr, { - results: 3, + results: 4, departure: when, stopovers: true }) diff --git a/test/vbb.js b/test/vbb.js index 81d669db..f4374703 100644 --- a/test/vbb.js +++ b/test/vbb.js @@ -54,7 +54,7 @@ test('journeys – Spichernstr. to Bismarckstr.', async (t) => { id: spichernstr, name: 'U Spichernstr.' }, bismarckstr, { - results: 3, + results: 4, departure: when, stopovers: true }) diff --git a/test/vbn.js b/test/vbn.js index 440ec64a..5c7bbb88 100644 --- a/test/vbn.js +++ b/test/vbn.js @@ -41,7 +41,7 @@ const bremerhavenHbf = '8000051' test.only('journeys – Bremen Hbf to Bremerhaven Hbf', async (t) => { const res = await client.journeys(bremenHbf, bremerhavenHbf, { - results: 3, + results: 4, departure: when, stopovers: true })