db-vendo-client/test/e2e/lib/journeys-fails-with-no-product.js
Kristjan ESPERANTO 66d9fb5194
apply linting rules
follow-up of 228c7253
2024-02-10 16:50:12 +01:00

23 lines
397 B
JavaScript

const journeysFailsWithNoProduct = async (cfg) => {
const {
test: t,
fetchJourneys,
fromId,
toId,
when,
products,
} = cfg;
const noProducts = Object.create(null);
for (let p of products) {
noProducts[p.id] = false;
}
await t.rejects(async () => {
await fetchJourneys(fromId, toId, {departure: when, products: noProducts});
});
};
export {
journeysFailsWithNoProduct,
};