mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-04-20 23:23:56 +03:00
fix test helpers 🐛
This commit is contained in:
parent
7f02bfe4d5
commit
df293e31cc
2 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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}]`)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue