doesNotThrow

View Source

Summary

Asserts that fn does not throw.

Signature

function doesNotThrow(fn: () => any, message: string): void;

Example

assert.doesNotThrow(() => JSON.parse('{}'))

Params

fn

The function expected not to throw.

message

Optional failure message.