From c04e041338ad815a37b1fb7b1fdb9cc1b477c52a Mon Sep 17 00:00:00 2001 From: Jannis R Date: Thu, 7 Feb 2019 18:06:15 +0100 Subject: [PATCH] make tests more robust :green_heart: --- test/cmta.js | 2 +- test/oebb.js | 5 +++-- test/saarfahrplan.js | 7 ++++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/test/cmta.js b/test/cmta.js index bb4df066..003c7587 100644 --- a/test/cmta.js +++ b/test/cmta.js @@ -98,7 +98,7 @@ test('Domain to 1104 Elm Street, Austin, TX 78703', async (t) => { test('Domain to Whole Foods Market - North Lamar Blvd', async (t) => { const wholeFoodsMarket = { type: 'location', - id: '9845477', + id: '9845565', // or `9871373` poi: true, name: 'Whole Foods Market - N Lamar Blvd', latitude: 30.270653, diff --git a/test/oebb.js b/test/oebb.js index cdd31be1..706acfb5 100644 --- a/test/oebb.js +++ b/test/oebb.js @@ -327,7 +327,8 @@ test('nearby Salzburg Hbf', async (t) => { }) test('locations named Salzburg', async (t) => { - const locations = await client.locations('Salzburg', { + const salzburgVolksgarten = '591161' + const locations = await client.locations('Salzburg volksgarten', { results: 20 }) @@ -337,7 +338,7 @@ test('locations named Salzburg', async (t) => { t.ok(locations.find(s => s.type === 'stop' || s.type === 'station')) t.ok(locations.find(s => s.poi)) // POIs t.ok(locations.some((s) => { - return s.station && s.station.id === salzburgHbf || s.id === salzburgHbf + return s.station && s.station.id === salzburgVolksgarten || s.id === salzburgVolksgarten })) t.end() diff --git a/test/saarfahrplan.js b/test/saarfahrplan.js index a6db9af8..3f9deff7 100644 --- a/test/saarfahrplan.js +++ b/test/saarfahrplan.js @@ -246,7 +246,7 @@ test('departures with stop object', async (t) => { t.end() }) -test('departures at Karlsplatz in direction of Pilgramgasse', async (t) => { +test('departures at Uhlandstr., Saarbrücken in direction of Landwehrplatz', async (t) => { const saarbrueckenLandwehrplatz = '10606' await testDeparturesInDirection({ test: t, @@ -286,7 +286,8 @@ test('nearby Saarbrücken Hbf', async (t) => { }) test('locations named Saarbrücken', async (t) => { - const locations = await client.locations('Saarbrücken', { + const aufDerWerthBürgerpark = '10204' + const locations = await client.locations('bürgerpark', { results: 20 }) @@ -296,7 +297,7 @@ test('locations named Saarbrücken', async (t) => { t.ok(locations.find(s => s.type === 'stop' || s.type === 'station')) t.ok(locations.find(s => s.poi)) // POIs t.ok(locations.some((s) => { - return s.station && s.station.id === saarbrueckenHbf || s.id === saarbrueckenHbf + return s.station && s.station.id === aufDerWerthBürgerpark || s.id === aufDerWerthBürgerpark })) t.end()