From df293e31cc612e16450651252d840d8d74af235d Mon Sep 17 00:00:00 2001 From: Jannis R Date: Mon, 7 May 2018 12:33:53 +0200 Subject: [PATCH] fix test helpers :bug: --- test/lib/earlier-later-journeys.js | 1 + test/lib/validators.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/test/lib/earlier-later-journeys.js b/test/lib/earlier-later-journeys.js index a9323815..bdf4eb1d 100644 --- a/test/lib/earlier-later-journeys.js +++ b/test/lib/earlier-later-journeys.js @@ -40,6 +40,7 @@ const testEarlierLaterJourneys = co(function* (cfg) { let earliestDep = Infinity, latestDep = -Infinity for (let j of model) { + if (j.legs[0].departure === null) continue const dep = +new Date(j.legs[0].departure) if (dep < earliestDep) earliestDep = dep else if (dep > latestDep) latestDep = dep diff --git a/test/lib/validators.js b/test/lib/validators.js index 14a4d353..8a19db86 100644 --- a/test/lib/validators.js +++ b/test/lib/validators.js @@ -57,7 +57,7 @@ const validateLocations = (val, locs, name = 'locations') => { a.ok(Array.isArray(locs), name + ' must be an array') a.ok(locs.length > 0, name + ' must not be empty') for (let i = 0; i < locs.length; i++) { - val.location(locs[i], name + `[${i}]`) + val.location(val, locs[i], name + `[${i}]`) } }