toThrowErrorAsync
Runs a function and asserts that it doesn’t throw an error or returns a promise that’s rejected.
toThrowErrorAsync(...args: any[]): Promise<Assertion<any>>
Note
This function is asynchronous and must beawait
-ed.
Parameters
- args — The arguments passed directly to the function, if any
Return value
A promise for a new assertion for the return value.
Related
- class NegatedAssertionRepresents a value ready to be asserted, using inverse logic.
- toThrowErrorAsync(…args)Runs a function and asserts that it throws an error or results in a promise that’s rejected.
- toThrowError(…args)Runs a function and asserts that it doesn’t throw an error when called with given arguments.