Vitest · Matcher
toThrow
toThrow checks that calling a function throws an error. You can also check the error message or compare the thrown value.
Last updated
Syntax
toThrow(expected?: any): Awaitable<void>In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
expectrejectstoEqualtoThrowError