db-vendo-client/test/db-stop.js

28 lines
702 B
JavaScript
Raw Normal View History

'use strict'
2021-05-20 16:42:43 +01:00
const tap = require('tap')
const createClient = require('..')
const rawProfile = require('../p/db')
const res = require('./fixtures/db-stop.json')
const expected = require('./fixtures/db-stop.js')
const client = createClient(rawProfile, 'public-transport/hafas-client:test')
const {profile} = client
const opt = {
linesOfStops: false, // parse & expose lines at the stop/station?
subStops: true,
entrances: true,
remarks: true,
}
2021-05-20 16:42:43 +01:00
tap.test('parses a stop() response correctly (DB)', (t) => {
const common = profile.parseCommon({profile, opt, res})
const ctx = {profile, opt, common, res}
const stop = profile.parseLocation(ctx, res.locL[0])
2021-05-20 16:42:43 +01:00
t.same(stop, expected)
t.end()
})