diff --git a/test/bvg.js b/test/bvg.js index 2226c438..35ad8a4a 100644 --- a/test/bvg.js +++ b/test/bvg.js @@ -107,7 +107,7 @@ test('journeys – only subway', co(function* (t) { for (let j = 0; j < journey.legs.length; j++) { const leg = journey.legs[j] - const name = `journeys[${i}].legs[${i}].line` + const name = `journeys[${i}].legs[${j}].line` if (leg.line) { t.equal(leg.line.mode, 'train', name + '.mode is invalid') t.equal(leg.line.product, 'subway', name + '.product is invalid') diff --git a/test/lib/validators.js b/test/lib/validators.js index 30e7122f..d5ba436d 100644 --- a/test/lib/validators.js +++ b/test/lib/validators.js @@ -98,11 +98,11 @@ const createValidateStopover = (cfg) => { const validateStopover = (val, s, name = 'stopover') => { if (is(s.arrival)) { val.date(val, s.arrival, name + '.arrival') - assertValidWhen(s.arrival, cfg.when, name) + assertValidWhen(s.arrival, cfg.when, name + '.arrival') } if (is(s.departure)) { val.date(val, s.departure, name + '.departure') - assertValidWhen(s.departure, cfg.when, name) + assertValidWhen(s.departure, cfg.when, name + '.departure') } if (!is(s.arrival) && !is(s.departure)) { a.fail(name + ' contains neither arrival nor departure') @@ -312,7 +312,7 @@ const createValidateArrivalOrDeparture = (type, cfg) => { anyOf(['stop', 'station'], val, dep.stop, name + '.stop') - assertValidWhen(dep.when, cfg.when, name) + assertValidWhen(dep.when, cfg.when, name + '.when') if (dep.delay !== null) { const msg = name + '.delay must be a number' a.strictEqual(typeof dep.delay, 'number', msg) diff --git a/test/oebb.js b/test/oebb.js index 0cbc9e48..d2240476 100644 --- a/test/oebb.js +++ b/test/oebb.js @@ -261,8 +261,7 @@ test('departures at Wien Leibenfrostgasse', co(function* (t) { for (let i = 0; i < deps.length; i++) { const dep = deps[i] - const msg = `deps[${i}].stop.id is invalid` - t.ok(ids.includes(dep.stop.id, msg)) + t.ok(ids.includes(dep.stop.id), `deps[${i}].stop.id ("${dep.stop.id}") is invalid`) } t.end()