mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 23:29:35 +02:00
26 lines
445 B
JavaScript
26 lines
445 B
JavaScript
const testLines = async (cfg) => {
|
|
const {
|
|
test: t,
|
|
fetchLines,
|
|
validate,
|
|
query,
|
|
} = cfg
|
|
|
|
const res = await fetchLines(query)
|
|
const {
|
|
lines,
|
|
realtimeDataUpdatedAt,
|
|
} = res
|
|
|
|
for (let i = 0; i < res.lines.length; i++) {
|
|
const l = res.lines[i]
|
|
const name = `res.lines[${i}]`
|
|
validate(t, l, 'line', name)
|
|
}
|
|
|
|
validate(t, realtimeDataUpdatedAt, 'realtimeDataUpdatedAt', 'res.realtimeDataUpdatedAt')
|
|
}
|
|
|
|
export {
|
|
testLines,
|
|
}
|