Last active
August 29, 2015 14:09
-
-
Save dbernar1/0473d3dcc49a97dca981 to your computer and use it in GitHub Desktop.
Adding a custom matcher for Jasmine
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.Matchers.prototype.toReturnAPromise = function() { | |
if ( 'function' !== typeof this.actual.then ) { | |
throw 'Did not return a promise'; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am not sure that this is a particularly good way to implement this, but it did work for my use case. YMMV. Please let me know if you know of a better way to accomplish this.