Skip to content

Instantly share code, notes, and snippets.

@kwilson
Created February 18, 2015 14:49
Show Gist options
  • Save kwilson/acae50cb8510ddc69744 to your computer and use it in GitHub Desktop.
Save kwilson/acae50cb8510ddc69744 to your computer and use it in GitHub Desktop.
mock promise
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