filmov
tv
Cypress Asynchronous Unit Tests Using Sinon.js And Chai
Показать описание
const fn = getTo(3, 500)
// call fn until it returns value 3?
const result = await retry(fn, function (n) { return n === 3 }, {
log,
limit: 5,
})
{
attempt: 1,
limit: 5,
value: 1,
successful: false,
},
])
{
attempt: 2,
limit: 5,
value: 2,
successful: false,
},
])
{
attempt: 3,
limit: 5,
value: 3,
successful: true,
},
])