hamjest
Version:
A library of composable matchers for defining meaningful and readable assertions in JavaScript.
23 lines (18 loc) • 424 B
JavaScript
;
const _ = require('lodash');
const TypeSafeMatcher = require('./TypeSafeMatcher');
function IsFunction() {
return _.create(new TypeSafeMatcher(), {
isExpectedType: function (actual) {
return _.isFunction(actual);
},
describeTo: function (description) {
description
.append('a function');
}
});
}
IsFunction.func = function () {
return new IsFunction();
};
module.exports = IsFunction;