Created
February 18, 2015 14:49
-
-
Save kwilson/acae50cb8510ddc69744 to your computer and use it in GitHub Desktop.
mock promise
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
function createMockPromise<T>(): ng.IPromise<T> { | |
return { | |
then: function (callback: () => ng.IHttpPromise<T>) { return callback(); }, | |
catch: function (callback: () => ng.IHttpPromise<T>) { return callback(); }, | |
finally: function (callback: () => ng.IHttpPromise<T>) { return callback(); } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment