@sprucelabs/test-utils 5.1.137 → 5.1.138
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -119,7 +119,9 @@ const assertUtil = {
|
|
|
119
119
|
checkDoesThrowError(matcher, err, msg) {
|
|
120
120
|
var _a, _b;
|
|
121
121
|
const message = (_b = (_a = err.stack) !== null && _a !== void 0 ? _a : err.message) !== null && _b !== void 0 ? _b : '**MISSING ERROR MESSAGE**';
|
|
122
|
-
if (typeof matcher === 'string' &&
|
|
122
|
+
if (typeof matcher === 'string' &&
|
|
123
|
+
message.search(matcher) === -1 &&
|
|
124
|
+
!message.includes(matcher)) {
|
|
123
125
|
this.fail(msg !== null && msg !== void 0 ? msg : `Expected thrown error whose message contains: \n\n${chalk_1.default.bold(matcher)}\n\nbut got back:\n\n\`${chalk_1.default.bold(message)}\`.`, '\n\nStack: ' + err.stack);
|
|
124
126
|
}
|
|
125
127
|
else if (matcher instanceof RegExp &&
|
|
@@ -113,7 +113,9 @@ const assertUtil = {
|
|
|
113
113
|
checkDoesThrowError(matcher, err, msg) {
|
|
114
114
|
var _a, _b;
|
|
115
115
|
const message = (_b = (_a = err.stack) !== null && _a !== void 0 ? _a : err.message) !== null && _b !== void 0 ? _b : '**MISSING ERROR MESSAGE**';
|
|
116
|
-
if (typeof matcher === 'string' &&
|
|
116
|
+
if (typeof matcher === 'string' &&
|
|
117
|
+
message.search(matcher) === -1 &&
|
|
118
|
+
!message.includes(matcher)) {
|
|
117
119
|
this.fail(msg !== null && msg !== void 0 ? msg : `Expected thrown error whose message contains: \n\n${chalk.bold(matcher)}\n\nbut got back:\n\n\`${chalk.bold(message)}\`.`, '\n\nStack: ' + err.stack);
|
|
118
120
|
}
|
|
119
121
|
else if (matcher instanceof RegExp &&
|