Function throws
Parameters
- expect: RegExp
A regular expression to match the exception message against
- func_or_promise: () => never
A function to call, or a promise to await
Optionaloptions: Annotation | TestOptionsTest compare options or annotation
Returns Error
The Error object thrown
- expect: RegExp
- throws(
expect: RegExp,
func_or_promise: Promise<unknown>,
options?: Annotation | TestOptions,
): Promise<Error>Expect a call or promise to throw
Parameters
- expect: RegExp
A regular expression to match the exception message against
- func_or_promise: Promise<unknown>
A function to call, or a promise to await
Optionaloptions: Annotation | TestOptionsTest compare options or annotation
Returns Promise<Error>
The Error object thrown
- expect: RegExp
- throws(
expect: RegExp,
func_or_promise: () => Promise<unknown>,
options?: Annotation | TestOptions,
): Promise<Error>Expect a call or promise to throw
Parameters
- expect: RegExp
A regular expression to match the exception message against
- func_or_promise: () => Promise<unknown>
A function to call, or a promise to await
Optionaloptions: Annotation | TestOptionsTest compare options or annotation
Returns Promise<Error>
The Error object thrown
- expect: RegExp
Expect a call or promise to throw
Parameters
- expect: RegExp
A regular expression to match the exception message against
- func_or_promise: () => unknown
A function to call, or a promise to await
Optionaloptions: Annotation | TestOptionsTest compare options or annotation
Returns Error
The Error object thrown
- expect: RegExp
Expect a call or promise to throw