assertthat
Version:
assertthat provides fluent TDD.
18 lines (17 loc) • 744 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.assertStringIsNotMatchingRegExp = void 0;
const errors_1 = require("../../errors");
const prettyPrint_1 = require("../../prettyPrint/typeAware/prettyPrint");
const defekt_1 = require("defekt");
const assertStringIsNotMatchingRegExp = function (actual, expected) {
if (!expected.test(actual)) {
return (0, defekt_1.value)();
}
return (0, defekt_1.error)(new errors_1.AssertionFailed({
message: 'The string is matching the regex.',
actual: (0, prettyPrint_1.prettyPrint)(actual),
expected: `To not match:\n${expected.toString()}`
}));
};
exports.assertStringIsNotMatchingRegExp = assertStringIsNotMatchingRegExp;