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.js25
1 files changed, 17 insertions, 8 deletions
diff --git a/test/service/exceptionHandlerSpec.js b/test/service/exceptionHandlerSpec.js
index 2f3d0e66..4ab94679 100644
--- a/test/service/exceptionHandlerSpec.js
+++ b/test/service/exceptionHandlerSpec.js
@@ -1,15 +1,24 @@
'use strict';
describe('$exceptionHandler', function() {
+ it('should log errors with single argument', function() {
+ module(function($provide){
+ $provide.service('$exceptionHandler', $ExceptionHandlerProvider);
+ });
+ inject(function($log, $exceptionHandler) {
+ $exceptionHandler('myError');
+ expect($log.error.logs.shift()).toEqual(['myError']);
+ });
+ });
- it('should log errors', function() {
- module(function($provide){
- $provide.service('$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.service('$exceptionHandler', $ExceptionHandlerProvider);
+ });
+ inject(function($log, $exceptionHandler) {
+ $exceptionHandler('myError', 'comment');
+ expect($log.error.logs.shift()).toEqual(['myError', 'comment']);
+ });
});
- });
});