aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLucas Galfasó2014-01-31 15:22:36 -0300
committerCaitlin Potter2014-01-31 14:38:06 -0500
commit074b0675a1f97dce07f520f1ae6198ed3c604000 (patch)
tree04cf1ededc29a9de7eb37bbc6f8f306237b537ac /test
parent5ed721b9b5e95ae08450e1ae9d5202e7f3f79295 (diff)
downloadangular.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.js7
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();
+ });
});