diff options
| author | Lucas Galfasó | 2014-01-31 15:22:36 -0300 | 
|---|---|---|
| committer | Caitlin Potter | 2014-01-31 14:38:06 -0500 | 
| commit | 074b0675a1f97dce07f520f1ae6198ed3c604000 (patch) | |
| tree | 04cf1ededc29a9de7eb37bbc6f8f306237b537ac /test | |
| parent | 5ed721b9b5e95ae08450e1ae9d5202e7f3f79295 (diff) | |
| download | angular.js-074b0675a1f97dce07f520f1ae6198ed3c604000.tar.bz2 | |
fix($q): make $q.reject support `finally` and `catch`
Add support for the functions `finally` and `catch` to the
promise returned by `$q.reject`
Closes #6048
Closes #6076
Diffstat (limited to 'test')
| -rw-r--r-- | test/ng/qSpec.js | 7 | 
1 files changed, 7 insertions, 0 deletions
| diff --git a/test/ng/qSpec.js b/test/ng/qSpec.js index 73579137..b12a4a8f 100644 --- a/test/ng/qSpec.js +++ b/test/ng/qSpec.js @@ -959,6 +959,13 @@ describe('q', function() {        mockNextTick.flush();        expect(log).toEqual(['errorBroken(rejected)->throw(catch me!)', 'errorAffected(catch me!)->reject(catch me!)']);      }); + + +    it('should have functions `finally` and `catch`', function() { +      var rejectedPromise = q.reject('rejected'); +      expect(rejectedPromise['finally']).not.toBeUndefined(); +      expect(rejectedPromise['catch']).not.toBeUndefined(); +    });    }); | 
