UNPKG

hamjest

Version:

A library of composable matchers for defining meaningful and readable assertions in JavaScript.

24 lines (19 loc) 485 B
'use strict'; const _create = require('lodash/create'); const _isFunction = require('lodash/isFunction'); 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;