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
Optional
annotation: AnnotationOptional annotation to log if the test fails
Returns Error
The Error object thrown
- expect: RegExp
- throws(
expect: RegExp,
func_or_promise: Promise<unknown>,
annotation?: Annotation,
): 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
Optional
annotation: AnnotationOptional annotation to log if the test fails
Returns Promise<Error>
The Error object thrown
- expect: RegExp
- throws(
expect: RegExp,
func_or_promise: () => Promise<unknown>,
annotation?: Annotation,
): 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
Optional
annotation: AnnotationOptional annotation to log if the test fails
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
Optional
annotation: AnnotationOptional annotation to log if the test fails
Returns Error
The Error object thrown
- expect: RegExp
Expect a call or promise to throw