From 2430f52bb97fa9d682e5f028c977c5bf94c5ec38 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Fri, 23 Mar 2012 14:03:24 -0700 Subject: chore(module): move files around in preparation for more modules --- test/ng/exceptionHandlerSpec.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test/ng/exceptionHandlerSpec.js (limited to 'test/ng/exceptionHandlerSpec.js') 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']); + }); + }); +}); -- cgit v1.2.3