Created
November 2, 2014 15:28
-
-
Save nakamura-to/51ffe880695868d63b4e to your computer and use it in GitHub Desktop.
Karma reporter shows a wrong stacktrace when a promise is resolved in next event loop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| describe('Karma reporter', function () { | |
| var $rootScope; | |
| var $q; | |
| beforeEach(inject(function (_$rootScope_, _$q_) { | |
| $rootScope = _$rootScope_; | |
| $q = _$q_; | |
| })); | |
| it('shows a wrong stacktrace when a promise is resolved in next event loop', function (done) { | |
| var deferred = $q.defer(); | |
| var promise = deferred.promise; | |
| promise.then(function () { | |
| Object.hello(); // TypeError | |
| done(); | |
| }); | |
| setTimeout(function () { | |
| deferred.resolve(); | |
| $rootScope.$apply(); | |
| done(); | |
| }, 50); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment