4.5
Version:
Monadic test assertions
23 lines • 554 B
JavaScript
;
var helpers_1 = require("../helpers");
function throws(f) {
return new Throws(f);
}
exports.throws = throws;
var Throws = (function () {
function Throws(f) {
this.f = f;
}
Throws.prototype.verify = function (verification) {
var f = this.f;
try {
var x = f();
verification.failure("Did not throw, returned: " + helpers_1.inspect(x));
}
catch (e) {
verification.success(e);
}
};
return Throws;
}());
//# sourceMappingURL=throws.js.map