exports.doesNotThrow = function (block, error, msg) { var err; try { block(); } catch (e) { err = e; } if (err) throw new Error(msg || fmt('Expected %s not to throw an error.', block.toString())); if (error && (err instanceof error)) { throw new Error(msg || fmt('Expected %s not to throw an %o.', block.toString(), error)); } };
exports.notStrictEqual = function (actual, expected, msg) { if (actual !== expected) return; throw new Error(msg || fmt('Expected %o not to strictly equal %o.', actual, expected)); };
exports.notDeepEqual = function (actual, expected, msg) { if (!equals(actual, expected)) return; throw new Error(msg || fmt('Expected %o not to deeply equal %o.', actual, expected)); };
exports.equal = function (actual, expected, msg) { if (actual == expected) return; throw new Error(msg || fmt('Expected %o to equal %o.', actual, expected)); };