Created
November 22, 2010 19:16
-
-
Save jorgemanrubia/710465 to your computer and use it in GitHub Desktop.
Jasmine factory for creating spy objects with common JQuery methods. For the common need of a mock object that need to act as a JQuery object ($() requires a method `remove` and `unbind` to exist)
This file contains 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
jasmine.create$SpyObj = function(name, listOfSpyMethods) { | |
listOfSpyMethods = listOfSpyMethods || ['unbind', 'remove']; | |
return jQuery.extend($('<div/>'), jasmine.createSpyObj(name, listOfSpyMethods)); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment