fix test helpers 🐛

This commit is contained in:
Jannis R 2018-05-07 12:33:53 +02:00
parent 7f02bfe4d5
commit df293e31cc
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5
2 changed files with 2 additions and 1 deletions

View file

@ -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

View file

@ -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}]`)
}
}