hamjest
Version:
A library of composable matchers for defining meaningful and readable assertions in JavaScript.
24 lines (19 loc) • 453 B
JavaScript
;
const _create = require('lodash/create');
const _isDate = require('lodash/isDate');
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;