It Should Help

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

throws(...args)

passes when invoking the function with args throws (inverted by a preceding not)

returns(...args)

invokes the function with args, asserts it does not throw, and returns the produced value for further chains

Plus the inherited not and defined().

Semantics

  • returns() under not asserts the invocation throws and yields undefined.

  • A null/undefined entry fails every check with The entry is not defined., regardless of not (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.

16 September 2026