mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-04-30 11:40:04 +03:00
DB E2E test: cleanup ✅
This commit is contained in:
parent
a0a4064bf0
commit
a6411707e1
1 changed files with 10 additions and 10 deletions
|
@ -45,11 +45,7 @@ const cfg = {
|
||||||
maxLongitude: 16.180237
|
maxLongitude: 16.180237
|
||||||
}
|
}
|
||||||
|
|
||||||
const validateStation = createValidateStation(cfg)
|
const validate = createValidate(cfg)
|
||||||
|
|
||||||
const validate = createValidate(cfg, {
|
|
||||||
station: validateStation
|
|
||||||
})
|
|
||||||
|
|
||||||
const assertValidPrice = (t, p) => {
|
const assertValidPrice = (t, p) => {
|
||||||
t.ok(p)
|
t.ok(p)
|
||||||
|
@ -317,12 +313,16 @@ tap.test('trip details', async (t) => {
|
||||||
|
|
||||||
const tripRes = await client.trip(p.tripId, p.line.name, {when})
|
const tripRes = await client.trip(p.tripId, p.line.name, {when})
|
||||||
|
|
||||||
const validateTrip = createValidateTrip(cfg)
|
|
||||||
const validate = createValidate(cfg, {
|
const validate = createValidate(cfg, {
|
||||||
trip: (validate, trip, name) => {
|
trip: (cfg) => {
|
||||||
trip = Object.assign({}, trip)
|
const validateTrip = createValidateTrip(cfg)
|
||||||
if (!trip.direction) trip.direction = 'foo' // todo, see #49
|
const validateTripWithFakeDirection = (val, trip, name) => {
|
||||||
validateTrip(validate, trip, name)
|
validateTrip(val, {
|
||||||
|
...trip,
|
||||||
|
direction: trip.direction || 'foo', // todo, see #49
|
||||||
|
}, name)
|
||||||
|
}
|
||||||
|
return validateTripWithFakeDirection
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
validate(t, tripRes, 'tripResult', 'tripRes')
|
validate(t, tripRes, 'tripResult', 'tripRes')
|
||||||
|
|
Loading…
Add table
Reference in a new issue