I got a problem when testing my angular service with jasmine 2.0
I have a method in my service, returning a promise.
Now I would like to test, that this method returns or rejects this promise.
I smallered it down to this simple test:
describe('calling a promise returning function', function() {
it('should resolve', function(done) {inject(function($q){
var a;
function call_me() {
a = $q.defer();
a.resolve();
return a.promise;
}
call_me().then(
function() {
console.log('yes');
expect(true).toBe(true);
},
function() {
console.log('nope');
expect(true).toBe(true);
}
).finally(done);
})});
});
But here I get the following return Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL. (1)