This repository has been archived by the owner on Aug 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
How to Unit test controller containing $mdDialog? #1482
Comments
Please post this in the Angular Material Forum |
FWIW, I just did this today. Inject I just extend the _.extend(_$mdDialog_, {
show: function(thing) {
deferred = $q.defer();
return deferred.promise;
}
}); In your test, just do this to get passed the promise.
|
|
Here is what worked in my case, hope it helps. `
}); |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I am unit testing an Angular controller with karma/Jasmine. The controller contains the $mdDialog service. How do I mock out $mdDialog?
The text was updated successfully, but these errors were encountered: