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