From 074b0675a1f97dce07f520f1ae6198ed3c604000 Mon Sep 17 00:00:00 2001 From: Lucas Galfasó Date: Fri, 31 Jan 2014 15:22:36 -0300 Subject: 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 --- test/ng/qSpec.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test') 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(); + }); }); -- cgit v1.2.3