You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've opened up an issue on the Chai As Promised plugin as well since I am uncertain what is happening, but the problem is that the afterEach hook in the test suite gets called after the timeout of 2000 milliseconds, thus my test fails.
"use strict";describe("Promise",function(){var$rootScope,$scope,$q;beforeEach(angular.mock.inject(function(_$rootScope_,_$q_){$rootScope=_$rootScope_;$q=_$q_;$scope=$rootScope.$new();}));afterEach(function(){$scope.$apply();});it("should resolve promise and eventually return",function(){vardefer=$q.defer();defer.resolve("incredible, this works like a charm");returndefer.promise.should.eventually.deep.equal("incredible, this works like a charm");});it("should resolve promises as expected",function(){varfst=$q.defer(),promise=fst.promise,snd=$q.defer();promise.then(function(value){value.should.eql("phew, this works");});fst.resolve("phew, this works");snd.resolve("wow, this works as well");varall=$q.all([promise,snd.promise]);returnall.should.be.fullfiled;});it("should reject promise because something happens along the way",function(){varpromise=$q.reject("sadly I failed for some stupid reason");promise["catch"](function(reason){reason.should.eql("sadly I failed for some stupid reason");});varall=$q.all([promise]);returnall.should.be.rejected;});});
Above is just a slim version of what I'm actually running, but the idea is the same and actually the above suite will fail the first and the last test because of a Error: timeout of 2000ms exceeded.
It is a bit strange and I could not figure out what is the cause, the only thing that I discovered as described on the other issue opened on the plugin is that there is some time spent somewhere after the return statement return all.should.be.rejected; and the call of afterEach.
The text was updated successfully, but these errors were encountered:
I've opened up an issue on the Chai As Promised plugin as well since I am uncertain what is happening, but the problem is that the
afterEach
hook in the test suite gets called after the timeout of2000
milliseconds, thus my test fails.Above is just a slim version of what I'm actually running, but the idea is the same and actually the above suite will fail the first and the last test because of a
Error: timeout of 2000ms exceeded
.It is a bit strange and I could not figure out what is the cause, the only thing that I discovered as described on the other issue opened on the plugin is that there is some time spent somewhere after the return statement
return all.should.be.rejected;
and the call ofafterEach
.The text was updated successfully, but these errors were encountered: