hamjest
Version:
A library of composable matchers for defining meaningful and readable assertions in JavaScript.
24 lines (19 loc) • 477 B
JavaScript
;
const _create = require('lodash/create');
const _isBoolean = require('lodash/isBoolean');
const TypeSafeMatcher = require('./TypeSafeMatcher');
function IsBoolean() {
return _create(new TypeSafeMatcher(), {
isExpectedType: function (actual) {
return _isBoolean(actual);
},
describeTo: function (description) {
description
.append('a boolean');
}
});
}
IsBoolean.bool = function () {
return new IsBoolean();
};
module.exports = IsBoolean;