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