-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Closed
Description
To check that async functions are not throwing exceptions I do this:
let allCorrect = true;
try {
await check();
} catch(err) {
allCorrect = false;
}
expect(allCorrect).toBe(true);
Is it possible to do something like this?
expect(async () => await check()).not.toThrow()
We came across this with @kentaromiura today.
GabrielDelepine, mjswensen, mathieumg, aymericbeaumet, lucasbento and 70 moreGabrielDelepine, ErikCupal, saeedtabrizi, artworkad, Gurenax and 2 morealfonsodev, jzavisek, GabrielDelepine, jure, mjswensen and 15 more