db-vendo-client/test/lib/journeys-fails-with-no-product.js

24 lines
447 B
JavaScript
Raw Normal View History

'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(() => {
2018-05-31 13:42:54 +02:00
client.journeys(fromId, toId, {departure: when, products})
// silence rejections, we're only interested in exceptions
.catch(() => {})
})
}
module.exports = journeysFailsWithNoProduct