doesNotReject

View Source

Summary

Asserts that the promise returned by fn does not reject.

Signature

function doesNotReject(fn: () => Promise<any>, message: string): Promise<void>;

Example

await assert.doesNotReject(() => fetch('/healthy'))

Params

fn

A function returning a promise.

message

Optional failure message.