mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 23:29:35 +02:00
TPG integration test ✅
This commit is contained in:
parent
fa9a8d9f7d
commit
2ec079adfc
1 changed files with 51 additions and 0 deletions
51
test/e2e/tpg.js
Normal file
51
test/e2e/tpg.js
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
const tap = require('tap')
|
||||||
|
|
||||||
|
const {createWhen} = require('./lib/util')
|
||||||
|
const createClient = require('../..')
|
||||||
|
const tpgProfile = require('../../p/tpg')
|
||||||
|
const createValidate = require('./lib/validate-fptf-with')
|
||||||
|
const testJourneysStationToAddress = require('./lib/journeys-station-to-address')
|
||||||
|
|
||||||
|
const when = createWhen(tpgProfile.timezone, tpgProfile.locale)
|
||||||
|
|
||||||
|
const cfg = {
|
||||||
|
when,
|
||||||
|
stationCoordsOptional: false,
|
||||||
|
products: tpgProfile.products,
|
||||||
|
minLatitude: 45.3184,
|
||||||
|
minLongitude: 4.4604,
|
||||||
|
maxLatitude: 47.2969,
|
||||||
|
maxLongitude: 7.8607,
|
||||||
|
}
|
||||||
|
|
||||||
|
const validate = createValidate(cfg)
|
||||||
|
|
||||||
|
const client = createClient(tpgProfile, 'public-transport/hafas-client:test')
|
||||||
|
|
||||||
|
const moillebeau = '100451'
|
||||||
|
|
||||||
|
tap.test('Moillebeau to Cours des Bastions 10', async (t) => {
|
||||||
|
const coursDesBastions10 = {
|
||||||
|
type: 'location',
|
||||||
|
id: '990001624',
|
||||||
|
address: 'Cours des Bastions 10, 1205 Genève',
|
||||||
|
latitude: 46.197768,
|
||||||
|
longitude: 6.148046,
|
||||||
|
}
|
||||||
|
|
||||||
|
const res = await client.journeys(moillebeau, coursDesBastions10, {
|
||||||
|
results: 3,
|
||||||
|
departure: when,
|
||||||
|
})
|
||||||
|
|
||||||
|
await testJourneysStationToAddress({
|
||||||
|
test: t,
|
||||||
|
res,
|
||||||
|
validate,
|
||||||
|
fromId: moillebeau,
|
||||||
|
to: coursDesBastions10,
|
||||||
|
})
|
||||||
|
t.end()
|
||||||
|
})
|
Loading…
Add table
Reference in a new issue