Custom matchers can be added in jasmine using the syntax:
jasmine.addMatchers([
toMatch: function () {
return {
compare: function (actual, expected) {
return {
pass: actual===expected,
message: "Expected actual to match expected...
Custom matchers will have their pass value negated when using 'not'. Custom matchers can have a negative compare attribute to explicitly handle cases where their negation is desired:
toMatch: function () {
return {
compare: function (actual, expected) {
return...