I am creating a test for angular controller and I want to create a mock service that returns promise. I found the solution here but this does not work with Controller As
. Any idea how would I be able to do it?
Asked
Active
Viewed 277 times
1
1 Answers
0
Manage to get it working by injecting scope in the test although my controller doesn't inject code (bit wierd but that is how was done by a PluralSight toturial by John Papa).
So I can call call my method as scope.controllerVM.doSomething();
and then make a call to scope.$digest()
to trigger call to the method

Junaid
- 1,708
- 16
- 25