aboutsummaryrefslogtreecommitdiffstats
path: root/test/service/exceptionHandlerSpec.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/service/exceptionHandlerSpec.js')
-rw-r--r--test/service/exceptionHandlerSpec.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/service/exceptionHandlerSpec.js b/test/service/exceptionHandlerSpec.js
new file mode 100644
index 00000000..59349065
--- /dev/null
+++ b/test/service/exceptionHandlerSpec.js
@@ -0,0 +1,23 @@
+describe('$exceptionHandler', function() {
+ var scope;
+
+ beforeEach(function(){
+ scope = angular.scope();
+ });
+
+
+ afterEach(function(){
+ dealoc(scope);
+ });
+
+
+ it('should log errors', function(){
+ var scope = createScope({}, {$exceptionHandler: $exceptionHandlerFactory},
+ {$log: $logMock}),
+ $log = scope.$service('$log'),
+ $exceptionHandler = scope.$service('$exceptionHandler');
+
+ $exceptionHandler('myError');
+ expect($log.error.logs.shift()).toEqual(['myError']);
+ });
+});