Answers for "jest test tothrow on an async function"

1

jest test tothrow on an async function

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