adapt tests & docs to 021ae45 & 3e672ee 📝

This commit is contained in:
Jannis R 2018-06-22 13:41:35 +02:00
parent 3e672eeabd
commit ce880c06bd
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5
2 changed files with 18 additions and 3 deletions

View file

@ -179,7 +179,9 @@ The response may look like this:
products: { /* … */ }
},
arrival: '2017-12-17T19:09:00.000+01:00',
departure: '2017-12-17T19:09:00.000+01:00'
arrivalPlatform: '1',
departure: '2017-12-17T19:09:00.000+01:00',
departurePlatform: '1'
}, /* … */ {
stop: {
type: 'station',
@ -189,7 +191,9 @@ The response may look like this:
products: { /* … */ }
},
arrival: '2017-12-17T19:17:00.000+01:00',
departure: '2017-12-17T19:17:00.000+01:00'
arrivalPlatform: '5',
departure: '2017-12-17T19:17:00.000+01:00',
departurePlatform: '5'
} ]
} ]
},

View file

@ -99,7 +99,18 @@ const createValidateStopover = (cfg) => {
a.strictEqual(typeof s.departureDelay, 'number', msg)
}
val.station(val, s.station, name + '.station')
if (is(s.arrivalPlatform)) {
const msg = name + '.arrivalPlatform must '
a.strictEqual(typeof s.arrivalPlatform, 'string', msg + 'be a string')
a.ok(s.arrivalPlatform, msg + 'not be empty')
}
if (is(s.departureDelay)) {
const msg = name + '.departurePlatform must '
a.strictEqual(typeof s.departurePlatform, 'string', msg + 'be a string')
a.ok(s.departurePlatform, msg + 'not be empty')
}
val.station(val, s.stop, name + '.stop')
}
return validateStopover
}