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