aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/angular-mocks.js4
-rw-r--r--test/angular-mocksSpec.js9
2 files changed, 11 insertions, 2 deletions
diff --git a/src/angular-mocks.js b/src/angular-mocks.js
index 916005a5..0b5c35b5 100644
--- a/src/angular-mocks.js
+++ b/src/angular-mocks.js
@@ -246,8 +246,8 @@ angular.service('$browser', function(){
*
* See {@link angular.mock} for more info on angular mocks.
*/
-angular.service('$exceptionHandler', function(e) {
- return function(e) {throw e;};
+angular.service('$exceptionHandler', function() {
+ return function(e) { throw e;};
});
diff --git a/test/angular-mocksSpec.js b/test/angular-mocksSpec.js
index dac691b0..c57b35e0 100644
--- a/test/angular-mocksSpec.js
+++ b/test/angular-mocksSpec.js
@@ -216,4 +216,13 @@ describe('mocks', function(){
});
});
+
+ describe('$exceptionHandler', function() {
+ it('should rethrow exceptions', function() {
+ var rootScope = angular.scope(),
+ exHandler = rootScope.$service('$exceptionHandler');
+
+ expect(function() { exHandler('myException') }).toThrow('myException');
+ });
+ });
});