improve E2E/integration test output

This commit is contained in:
Jannis R 2020-08-18 02:13:33 +02:00 committed by Jannis Redmann
parent 25fb25c18d
commit 2d139c8235
2 changed files with 6 additions and 5 deletions

View file

@ -29,7 +29,7 @@ const testDeparturesInDirection = async (cfg) => {
t.ok(trip.stopovers.some(st => (
st.stop.station && directionIds.includes(st.stop.station.id) ||
directionIds.includes(st.stop.id)
)), `trip ${dep.tripId} of ${name} has no stopover at ${directionIds}`)
)), `trip ${dep.tripId} of ${name} has no stopover at ${directionIds.join('/')}`)
}
}

View file

@ -447,17 +447,18 @@ const createValidateMovement = (cfg) => {
const lName = name + '.location'
val.location(val, m.location, lName)
const s = `${m.location.latitude}|${m.location.longitude} ${m.line && m.line.name}`
if ('number' === typeof maxLatitude) {
a.ok(m.location.latitude <= maxLatitude, lName + '.latitude is too large')
a.ok(m.location.latitude <= maxLatitude, lName + '.latitude is too large: ' + s)
}
if ('number' === typeof minLatitude) {
a.ok(m.location.latitude >= minLatitude, lName + '.latitude is too small')
a.ok(m.location.latitude >= minLatitude, lName + '.latitude is too small: ' + s)
}
if ('number' === typeof maxLongitude) {
a.ok(m.location.longitude <= maxLongitude, lName + '.longitude is too large')
a.ok(m.location.longitude <= maxLongitude, lName + '.longitude is too large: ' + s)
}
if ('number' === typeof minLongitude) {
a.ok(m.location.longitude >= minLongitude, lName + '.longitude is too small')
a.ok(m.location.longitude >= minLongitude, lName + '.longitude is too small: ' + s)
}
a.ok(Array.isArray(m.nextStopovers), name + '.nextStopovers must be an array')