2

I've been writing some unit tests in Jasmine and I have a function that returns a promise in a service which I use in my own factory. I'm doing the following steps:

inject(function(_$rootScope_, _$q_, swIncludedService){
includeDeferred = q.defer();
includeDeferred.resolve();
spyOn(swIncludedServiceMock,'testMethod').andReturn(includeDeferred.promise);
});

it('....',function(){
rootScope.$apply();
expectSomething...
});

I did some debugging and it goes through my promise function but after finishing the last line it goes into StateBrowser and throws this error: Could find state for path.: $root.

0 Answers0