mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 15:19:35 +02:00
23 lines
436 B
JavaScript
23 lines
436 B
JavaScript
'use strict'
|
|
|
|
const journeysFailsWithNoProduct = (cfg) => {
|
|
const {
|
|
test: t,
|
|
fetchJourneys,
|
|
fromId,
|
|
toId,
|
|
when,
|
|
products
|
|
} = cfg
|
|
|
|
const productsObj = Object.create(null)
|
|
for (let p of products) productsObj[p.id] = false
|
|
|
|
t.throws(() => {
|
|
client.journeys(fromId, toId, {when, products})
|
|
// silence rejections, we're only interested in exceptions
|
|
.catch(() => {})
|
|
})
|
|
}
|
|
|
|
module.exports = journeysFailsWithNoProduct
|