mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 23:29:35 +02:00
28 lines
761 B
JavaScript
28 lines
761 B
JavaScript
|
'use strict'
|
||
|
|
||
|
const tapePromise = require('tape-promise').default
|
||
|
const tape = require('tape')
|
||
|
|
||
|
const createClient = require('..')
|
||
|
const rawProfile = require('../p/insa')
|
||
|
const res = require('./fixtures/insa-stop.json')
|
||
|
const expected = require('./fixtures/insa-stop.js')
|
||
|
|
||
|
const test = tapePromise(tape)
|
||
|
const client = createClient(rawProfile, 'public-transport/hafas-client:test')
|
||
|
const {profile} = client
|
||
|
|
||
|
const opt = {
|
||
|
linesOfStops: false, // parse & expose lines at the stop/station?
|
||
|
remarks: true,
|
||
|
}
|
||
|
|
||
|
test('parses a stop() response correctly (INSA)', (t) => {
|
||
|
const common = profile.parseCommon({profile, opt, res})
|
||
|
const ctx = {profile, opt, common, res}
|
||
|
const stop = profile.parseLocation(ctx, res.locL[0])
|
||
|
|
||
|
t.deepEqual(stop, expected)
|
||
|
t.end()
|
||
|
})
|