Method Verifier Reference
Created by should().method<R>(entry: ((...params: any[]) => R) | null | undefined). Both checks invoke the function with the arguments they are given and assert how the invocation ends.
Methods
Method | Role |
|---|---|
| passes when invoking the function with |
| invokes the function with |
Plus the inherited not and defined().
Semantics
returns()undernotasserts the invocation throws and yieldsundefined.A
null/undefinedentry fails every check withThe entry is not defined., regardless ofnot(see Concepts).The thrown error itself is not inspected — any exception counts; assert on it separately when its shape matters.
Representative messages
The method didn't throw./The method did throw, but should not.The method threw instead of returning./The method did return a value, but should not.
Guide: Methods.