KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a custom matcher in some Jasmine test specs of the form: this.addMatchers({ checkContains: function(elem){ var found = false; $.each( this.actual, function( actualItem ){ // Check if these objects contain the same properties. found = found || actualItem.thing == elem; }); return found; } }); Of course, actualItem.thing == elem doesn't actually compare object contents- I have to use one of the more complex solutions in Object comparison in JavaScript . I can't help but notice, though, that Jasmine already has a nice object equality checker: expect(x).toEqual(y) . Is there any way to use that within a custom matcher? Is there any general way to use matchers within custom matchers?
Tags (comma-separated)
Save Edits
Cancel