aboutsummaryrefslogtreecommitdiffstats
path: root/test/ng/exceptionHandlerSpec.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/ng/exceptionHandlerSpec.js')
-rw-r--r--test/ng/exceptionHandlerSpec.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/ng/exceptionHandlerSpec.js b/test/ng/exceptionHandlerSpec.js
new file mode 100644
index 00000000..3f3dd800
--- /dev/null
+++ b/test/ng/exceptionHandlerSpec.js
@@ -0,0 +1,24 @@
+'use strict';
+
+describe('$exceptionHandler', function() {
+ it('should log errors with single argument', function() {
+ module(function($provide){
+ $provide.provider('$exceptionHandler', $ExceptionHandlerProvider);
+ });
+ inject(function($log, $exceptionHandler) {
+ $exceptionHandler('myError');
+ expect($log.error.logs.shift()).toEqual(['myError']);
+ });
+ });
+
+
+ it('should log errors with multiple arguments', function() {
+ module(function($provide){
+ $provide.provider('$exceptionHandler', $ExceptionHandlerProvider);
+ });
+ inject(function($log, $exceptionHandler) {
+ $exceptionHandler('myError', 'comment');
+ expect($log.error.logs.shift()).toEqual(['myError', 'comment']);
+ });
+ });
+});