We have rather complicated api that should be nested with multiple parameters. Now tests looks like callback hell
[true, false, null].forEach(customer => {
[true, false, null].forEach(sale => {
it('test', ()=> {
// Do something with customer and sale
})
})
})
Tests can have up to 10 parameters and all should be checked.
I am thinking of switching to typescript. So I wonder if there is a possibility to rewrite test to something like
let customer: []
@param(customer, [true, false, null])
it('test', ()=>{})
So that the functionality stays the same. Is it any way for doing that?