hamjest
Version:
A library of composable matchers for defining meaningful and readable assertions in JavaScript.
20 lines (16 loc) • 371 B
JavaScript
;
const _isRegExp = require('lodash/isRegExp');
const TypeSafeMatcher = require('./TypeSafeMatcher');
class IsRegExp extends TypeSafeMatcher {
isExpectedType(actual) {
return _isRegExp(actual);
}
describeTo(description) {
description
.append('a regular expression');
}
static regExp() {
return new IsRegExp();
}
}
module.exports = IsRegExp;