DongThin / my-love-e2e-testing

e2e testing with cypress
2 stars 0 forks source link

Promise + stub using done function, async await and assert fail(throw err) #21

Closed DongThin closed 6 months ago

DongThin commented 6 months ago
test('This function completes successfully', function(done) {
    functionToTest (88_888_888, 5, jun23)
        .then((result) => {
            //assert here
            done();
        })
        .catch((function(error)  {
        //...
        done(); //Just call 'done' in case of error, it will stop the test running and display the error
});
})