Created
November 10, 2012 22:56
-
-
Save m4nuC/4052863 to your computer and use it in GitHub Desktop.
Jasmine Object instance Matchers and typeof matcher
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({ | |
toBeInstanceOf : function( expected ) { | |
return this.actual instanceof expected && this.actual.length > 0; | |
}, | |
toBeA: function( expected ) { | |
return typeof this.actual === expected; | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment