Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const forms = {
- travel: TravelForms,
- realty: RealtyForms,
- life: LifeForms
- }
- const insurers = [Insurer1, Insurer2, Insurer3, Insurer4, Insurer5, Insurer6, Insurer7];
- Object.keys(forms).map((key) => {
- let insurersForType = insurers.reduce((acc, Insurer) => {
- if (Insurer.acceptableTypes.includes(key)) {
- acc.push(Insurer);
- }
- return acc;
- }, []);
- let insurersWithForm = [];
- forms[key].map((form) => {
- insurersForType.map((Insurer) => {
- insurersWithForm.push(new Insurer(form.payload))
- })
- })
- describe(`${key}`, () => {
- insurersWithForm.map((insurer) => {
- it(`${insurer.constructor.name} cost should be above 0`, () => {
- return insurer.request(`${key}`)
- .then(res => (res.system.cost.value).should.be.above(0))
- .catch(err => {
- console.log('ERROR', err);
- true.should.be.false })
- })
- })
- })
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement