adapt tests to 7e39a2f

This commit is contained in:
Jannis R 2019-02-14 14:06:54 +01:00
parent 7e39a2f333
commit 3b0740d310
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5
2 changed files with 10 additions and 10 deletions

View file

@ -65,7 +65,7 @@ const testEarlierLaterJourneys = async (cfg) => {
}) })
for (let j of earlier.journeys) { for (let j of earlier.journeys) {
const firstLeg = j.legs[0] const firstLeg = j.legs[0]
const dep = new Date(firstLeg.departure || firstLeg.formerScheduledDeparture) const dep = new Date(firstLeg.departure || firstLeg.scheduledDeparture)
t.ok(dep < earliestDep) t.ok(dep < earliestDep)
} }
@ -76,7 +76,7 @@ const testEarlierLaterJourneys = async (cfg) => {
}) })
for (let j of later.journeys) { for (let j of later.journeys) {
const firstLeg = j.legs[0] const firstLeg = j.legs[0]
const dep = new Date(firstLeg.departure || firstLeg.formerScheduledDeparture) const dep = new Date(firstLeg.departure || firstLeg.scheduledDeparture)
t.ok(dep > latestDep) t.ok(dep > latestDep)
} }
} }

View file

@ -126,20 +126,20 @@ const createValidateStopover = (cfg) => {
a.strictEqual(typeof s.arrivalPlatform, 'string', msg + 'be a string') a.strictEqual(typeof s.arrivalPlatform, 'string', msg + 'be a string')
a.ok(s.arrivalPlatform, msg + 'not be empty') a.ok(s.arrivalPlatform, msg + 'not be empty')
} }
if (is(s.formerScheduledArrivalPlatform)) { if (is(s.scheduledArrivalPlatform)) {
const msg = name + '.formerScheduledArrivalPlatform must ' const msg = name + '.scheduledArrivalPlatform must '
a.strictEqual(typeof s.formerScheduledArrivalPlatform, 'string', msg + 'be a string') a.strictEqual(typeof s.scheduledArrivalPlatform, 'string', msg + 'be a string')
a.ok(s.formerScheduledArrivalPlatform, msg + 'not be empty') a.ok(s.scheduledArrivalPlatform, msg + 'not be empty')
} }
if (is(s.departurePlatform)) { if (is(s.departurePlatform)) {
const msg = name + '.departurePlatform must ' const msg = name + '.departurePlatform must '
a.strictEqual(typeof s.departurePlatform, 'string', msg + 'be a string') a.strictEqual(typeof s.departurePlatform, 'string', msg + 'be a string')
a.ok(s.departurePlatform, msg + 'not be empty') a.ok(s.departurePlatform, msg + 'not be empty')
} }
if (is(s.formerScheduledDeparturePlatform)) { if (is(s.scheduledDeparturePlatform)) {
const msg = name + '.formerScheduledDeparturePlatform must ' const msg = name + '.scheduledDeparturePlatform must '
a.strictEqual(typeof s.formerScheduledDeparturePlatform, 'string', msg + 'be a string') a.strictEqual(typeof s.scheduledDeparturePlatform, 'string', msg + 'be a string')
a.ok(s.formerScheduledDeparturePlatform, msg + 'not be empty') a.ok(s.scheduledDeparturePlatform, msg + 'not be empty')
} }
anyOf(['stop', 'station'], val, s.stop, name + '.stop') anyOf(['stop', 'station'], val, s.stop, name + '.stop')