Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.actualExceptionStack = err.stack;
}
if (!err) {
if (typeof matcher === "object") {
return this.fail(typeNoExceptionMessage);
}
return this.fail("message");
}
if (typeof matcher === "object" && !samsam.match(err, matcher)) {
var prop;
for (prop in matcher) {
if (
hasOwnProperty(matcher, prop) &&
!samsam.match(err[prop], matcher[prop])
) {
return this.fail(typeFailMessage);
}
}
return true;
}
if (typeof matcher === "function" && matcher(err) !== true) {
return this.fail(matchFailMessage);
}
return true;
},
var err = captureException(callback);
if (err) {
this.actualExceptionType = err.name;
this.actualExceptionMessage = err.message;
this.actualExceptionStack = err.stack;
}
if (!err) {
if (typeof matcher === "object") {
return this.fail(typeNoExceptionMessage);
}
return this.fail("message");
}
if (typeof matcher === "object" && !samsam.match(err, matcher)) {
var prop;
for (prop in matcher) {
if (
hasOwnProperty(matcher, prop) &&
!samsam.match(err[prop], matcher[prop])
) {
return this.fail(typeFailMessage);
}
}
return true;
}
if (typeof matcher === "function" && matcher(err) !== true) {
return this.fail(matchFailMessage);
}
assert: function(actual, matcher) {
return samsam.match(actual, matcher);
},
assertMessage:
assert: function(actual, matcher) {
var parsed;
try {
parsed = JSON.parse(actual);
} catch (e) {
return this.fail(parseErrorMessage);
}
return samsam.match(parsed, matcher);
},
assertMessage: