mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 07:09:35 +02:00
fix ÖBB tests 💚
This commit is contained in:
parent
a28ead4cc1
commit
0ee53ff624
2 changed files with 6 additions and 6 deletions
|
@ -4,9 +4,9 @@ let captureStackTrace = () => {}
|
||||||
if (process.env.NODE_ENV === 'dev') {
|
if (process.env.NODE_ENV === 'dev') {
|
||||||
captureStackTrace = require('capture-stack-trace')
|
captureStackTrace = require('capture-stack-trace')
|
||||||
}
|
}
|
||||||
|
const {stringify} = require('query-string')
|
||||||
const Promise = require('pinkie-promise')
|
const Promise = require('pinkie-promise')
|
||||||
const {fetch} = require('fetch-ponyfill')({Promise})
|
const {fetch} = require('fetch-ponyfill')({Promise})
|
||||||
const {stringify} = require('query-string')
|
|
||||||
|
|
||||||
const request = (profile, data) => {
|
const request = (profile, data) => {
|
||||||
const body = profile.transformReqBody({lang: 'en', svcReqL: [data]})
|
const body = profile.transformReqBody({lang: 'en', svcReqL: [data]})
|
||||||
|
|
10
test/oebb.js
10
test/oebb.js
|
@ -261,12 +261,12 @@ test('Wien to Klagenfurt Hbf with stopover at Salzburg Hbf', co.wrap(function* (
|
||||||
results: 1
|
results: 1
|
||||||
})
|
})
|
||||||
|
|
||||||
const i = journey.legs.findIndex(leg => leg.destination.id === salzburgHbf)
|
const i1 = journey.legs.findIndex(leg => leg.destination.id === salzburgHbf)
|
||||||
t.ok(i >= 0, 'no leg with Hannover Hbf as destination')
|
t.ok(i1 >= 0, 'no leg with Salzburg Hbf as destination')
|
||||||
|
|
||||||
const nextLeg = journey.legs[i + 1]
|
const i2 = journey.legs.findIndex(leg => leg.origin.id === salzburgHbf)
|
||||||
t.ok(nextLeg)
|
t.ok(i2 >= 0, 'no leg with Salzburg Hbf as origin')
|
||||||
t.equal(nextLeg.origin.id, salzburgHbf)
|
t.ok(i2 > i1, 'leg with Salzburg Hbf as origin must be after leg to it')
|
||||||
|
|
||||||
t.end()
|
t.end()
|
||||||
}))
|
}))
|
||||||
|
|
Loading…
Add table
Reference in a new issue