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