I have a http service that uses a logger object defined in a common class.
This is how the call is made.
common.logger.getLogHttpFn(serviceId)
How do I create a mock in my unit test code.
I am trying something like this but it throws an error Undefined is not an
object. Evaluating common.logger.getLogHttpFn
Please let me know what is wrong here.
module('my.services','common', function ($provide) {
loggerMock = jasmine.createSpyObj('logger', ['getLogHttpFn']);
commonMock = jasmine.createSpy('common');
$provide.value('logger', loggerMock);
$provide.value('common', loggerMock);
});
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.