UNPKG

assertthat

Version:
18 lines (17 loc) 786 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.assertStringIsNotContainingString = void 0; const errors_1 = require("../../errors"); const prettyPrint_1 = require("../../prettyPrint/typeAware/prettyPrint"); const defekt_1 = require("defekt"); const assertStringIsNotContainingString = function (actual, expected) { if (!actual.includes(expected)) { return (0, defekt_1.value)(); } return (0, defekt_1.error)(new errors_1.AssertionFailed({ message: 'The string is containing the sub-string.', actual: (0, prettyPrint_1.prettyPrint)(actual), expected: `To not contain:\n${(0, prettyPrint_1.prettyPrint)(expected)}` })); }; exports.assertStringIsNotContainingString = assertStringIsNotContainingString;