mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 07:09:35 +02:00
adapt docs & tests to 0e1fcb0
📝 ✅
This commit is contained in:
parent
0e1fcb0c99
commit
c1bb9a6a5c
4 changed files with 9 additions and 7 deletions
|
@ -222,8 +222,8 @@ The `Promise` returned by `journeys()` will resolve with an object with the `jou
|
|||
},
|
||||
departure: '2018-07-11T00:01:00.000+02:00',
|
||||
arrival: '2018-07-11T00:10:00.000+02:00',
|
||||
mode: 'walking',
|
||||
public: true,
|
||||
walking: true,
|
||||
distance: 558
|
||||
} ]
|
||||
} ],
|
||||
|
|
|
@ -124,8 +124,8 @@ The returned [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript
|
|||
products: { /* … */ }
|
||||
},
|
||||
arrival: '2017-12-17T17:33:00.000+01:00',
|
||||
mode: 'walking',
|
||||
public: true
|
||||
public: true,
|
||||
walking: true
|
||||
}, {
|
||||
id: '1|70906|0|81|17122017',
|
||||
origin: {
|
||||
|
|
|
@ -221,7 +221,11 @@ const createValidateJourneyLeg = (cfg) => {
|
|||
}
|
||||
}
|
||||
|
||||
if (leg.mode === 'walking') {
|
||||
// todo: leg.public
|
||||
if ('walking' in leg) {
|
||||
a.strictEqual(typeof leg.walking, 'boolean', name + '.walking must be a boolean')
|
||||
}
|
||||
if (leg.walking) {
|
||||
if (leg.distance !== null) {
|
||||
const msg = name + '.distance must be '
|
||||
a.strictEqual(typeof leg.distance, 'number', msg + 'a number')
|
||||
|
|
|
@ -61,9 +61,7 @@ const validateLine = (validate, l, name) => {
|
|||
const _validateJourneyLeg = createValidateJourneyLeg(cfg)
|
||||
const validateJourneyLeg = (validate, l, name) => {
|
||||
_validateJourneyLeg(validate, l, name)
|
||||
if (l.mode !== 'walking') {
|
||||
validateDirection(l.direction, name + '.direction')
|
||||
}
|
||||
if (!l.walking) validateDirection(l.direction, name + '.direction')
|
||||
}
|
||||
|
||||
const _validateDeparture = createValidateDeparture(cfg)
|
||||
|
|
Loading…
Add table
Reference in a new issue