Answers for "jest expect async function to throw error"

1

jest expect async function to throw error

it('should test async errors', async () =>  {        
    await expect(failingAsyncTest())
    .rejects
    .toThrow('I should fail');
});
Posted by: Guest on January-10-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language