Skip to content

Commit

Permalink
Wrap HTML elements in $ so matchers still work
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinsawicki committed Sep 10, 2014
1 parent 61166bf commit c141448
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vendor/jasmine-jquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ jasmine.JQuery.matchersClass = {};
var builtInMatcher = jasmine.Matchers.prototype[methodName];

jasmine.JQuery.matchersClass[methodName] = function() {
if (this.actual instanceof HTMLElement) {
this.actual = jQuery(this.actual);
}
if (this.actual instanceof jQuery) {
var result = jQueryMatchers[methodName].apply(this, arguments);
this.actual = jasmine.JQuery.elementToString(this.actual);
Expand Down

0 comments on commit c141448

Please sign in to comment.