From ef40e827aedef23a1e0f6f06e4f54b05c179e785 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Tue, 13 Nov 2018 20:34:12 +0100 Subject: [PATCH] fix tests :green_heart: --- test/lib/journeys-fails-with-no-product.js | 8 ++++---- test/lib/validators.js | 2 +- test/nahsh.js | 6 +++--- test/vbn.js | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/test/lib/journeys-fails-with-no-product.js b/test/lib/journeys-fails-with-no-product.js index f3ee4de8..052b0643 100644 --- a/test/lib/journeys-fails-with-no-product.js +++ b/test/lib/journeys-fails-with-no-product.js @@ -10,14 +10,14 @@ const journeysFailsWithNoProduct = (cfg) => { products } = cfg - const productsObj = Object.create(null) - for (let p of products) productsObj[p.id] = false + const noProducts = Object.create(null) + for (let p of products) noProducts[p.id] = false t.throws(() => { - client.journeys(fromId, toId, {departure: when, products}) + fetchJourneys(fromId, toId, {departure: when, products: noProducts}) // silence rejections, we're only interested in exceptions .catch(() => {}) - }) + }, 'no products used') } module.exports = journeysFailsWithNoProduct diff --git a/test/lib/validators.js b/test/lib/validators.js index cd823580..a4dcce1f 100644 --- a/test/lib/validators.js +++ b/test/lib/validators.js @@ -332,7 +332,7 @@ const validateMovement = (val, m, name = 'movement') => { a.ok(Array.isArray(m.nextStops), name + '.nextStops must be an array') for (let i = 0; i < m.nextStops.length; i++) { const st = m.nextStops[i] - val.stopover(val, m.nextStops[i], name + `.nextStops[${i}]`) + val.stopover(val, st, name + `.nextStops[${i}]`) } a.ok(Array.isArray(m.frames), name + '.frames must be an array') diff --git a/test/nahsh.js b/test/nahsh.js index be005d7a..d6fdf978 100644 --- a/test/nahsh.js +++ b/test/nahsh.js @@ -306,9 +306,9 @@ test('locations named Kiel', co(function* (t) { validate(t, locations, 'locations', 'locations') t.ok(locations.length <= 20) - t.ok(locations.find(s => s.type === 'stop' || s.type === 'station')) - t.ok(locations.find(s => s.id && s.name)) // POIs - t.ok(locations.some(l => l.station && s.station.id === kielHbf || l.id === kielHbf)) + t.ok(locations.find(l => l.type === 'stop' || l.type === 'station')) + t.ok(locations.find(l => l.id && l.name)) // POIs + t.ok(locations.some(l => l.station && l.station.id === kielHbf || l.id === kielHbf)) t.end() })) diff --git a/test/vbn.js b/test/vbn.js index 6b6bacea..d14ac1d2 100644 --- a/test/vbn.js +++ b/test/vbn.js @@ -230,7 +230,7 @@ test.skip('locations named Magdeburg', co(function*(t) { t.ok(locations.find(s => s.type === 'stop' || s.type === 'station')) t.ok(locations.find(s => s.id && s.name)) // POIs - t.ok(locations.some((loc) => { + t.ok(locations.some((l) => { // todo: trim IDs if (l.station) { if (l.station.id === '008010224' || l.station.id === bremenHbf) return true