Global

Methods

asyncTest(thunk) → {Promise}

Will automatically wrap test in a catch block to catch any errors and call done afterwards. Use this in place of (done) => { <TEST> }.

Parameters:
Name Type Description
thunk function

asynchronous test that returns a Promise

Source:
Returns:

Resolves after running test

Type
Promise

shouldReject(thunk, reason) → {Promise}

Wrapper for tests that should reject.

Parameters:
Name Type Description
thunk function

Code to execute that should Promise.reject

reason string | Error | RegExp

Expected value that thunk should reject with

Source:
Returns:

Resolves after checking expectations.

Type
Promise

shouldResolve(thunk, expectedValueopt, matcheropt) → {Promise}

Wrapper for tests that should resolve.

Parameters:
Name Type Attributes Description
thunk function

Code to execute that should Promise.resolve

expectedValue object <optional>

Expected value that thunk should resolve with

matcher function <optional>

Custom matcher function of the form (expected, actual) => Boolean.

Source:
Returns:

Resolves after checking expectations.

Type
Promise