Questions tagged [jasmine-async]

3 questions
3
votes
1 answer

Jasmine 2.0: Asynchronous test case

I am trying to perform an asynchronous unit test: it('Async thing', function (done) { scope.$on('async-stuff-happened', function (e) { console.log(e); done(); expect(e.stuff).toEqual("stuff"); }); …
vtortola
  • 34,709
  • 29
  • 161
  • 263
1
vote
2 answers

jasmine 2.0 testing angularjs factory method which returns a promise

when i am trying to test a function which returns a promise i get the following error: "Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL. " my spec is as follows: describe('async…
Soham Nakhare
  • 425
  • 4
  • 18
0
votes
1 answer

How to test async Call for Angular service

I have the following Angular service method updateStorage(): void { this.authServiceRef = this.authService.authRequest('storage', {}).subscribe((result) => { this.storage = this.buildStorage(result); this.storageUpdate.emit({…
Kaloyan Stamatov
  • 3,894
  • 1
  • 20
  • 30