Testing AngularJS promises in Jasmine 2.0
After your call to promise.resolve(): Call $timeout.flush(). This will force a digest cycle and propagate the promise resolution Call done(). This tells Jasmine the async tests have completed Here’s an example (Demo on Plunker): describe(‘AngularJS promises and Jasmine 2.0’, function() { var $q, $timeout; beforeEach(inject(function(_$q_, _$timeout_) { // Set `$q` and `$timeout` before tests run … Read more