when passed as parameters to
- <array-like> [when] passed as parameters to [constructor] <function> <assertion?>
- <array-like> [when] passed as parameters to [async] <function> <assertion?>
Apply a function to the subject array (or array-like object), then delegate the return value to another assertion.
In case of a failing expectation you get the following output:
To call an node-style async function, use the
async flag to automatically
add a callback to the parameter list and do further assertions on the value it
passes to the callback.
The assertion will fail if the async function passes an error to the callback.
You can also use the
constructor flag to create an instance of a constructor
function (using the
If you don't provide an assertion to delegate to, the return value will be provided as the fulfillment value of the promise: