Hi Garry,
Thanks for your help.
I added the basicService example to my project just for sanity check and it worked.
However, I'm using a decorated $log. That is, I need not only to inject $log, but also augment its methods.
For instance, I have a getInstance function on $log, which I'm injecting on my tests using the code below.
beforeEach(function() {
module('esxUiApp.services.VimApi', function($provide) {
var MockLog = {
getInstance: jasmine.createSpy('getInstance')
};
$provide.value('$log', MockLog);
});
});
And as you can imagine, tests fail when it finds any other native method on $log, such as debug().
I also thought about mocking the whole $log object, but I'd like to see the logs in my test output.
Any ideas?
Cheers,
George