Created
October 9, 2011 14:16
-
-
Save searls/1273736 to your computer and use it in GitHub Desktop.
Just replaced 99% of what I use jasmine-jquery for in 10 lines.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
beforeEach(function() { | |
this.addMatchers({ | |
toIs: function(selector) { | |
return this.actual.is(selector); | |
}, | |
toHas: function(selector) { | |
return this.actual.find(selector).length > 0; | |
} | |
}); | |
}); | |
/* examples: | |
expect($result).toIs('div.pants'); //it should match this. uses is() | |
expect($container).toHas('.fax'); //check for children that match this. uses find() | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment