2011-07-17 08:05:43 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
2011-02-15 06:12:45 +00:00
|
|
|
describe('$exceptionHandler', function() {
|
2011-12-14 08:28:16 +00:00
|
|
|
it('should log errors with single argument', function() {
|
|
|
|
|
module(function($provide){
|
2012-03-08 23:59:32 +00:00
|
|
|
$provide.provider('$exceptionHandler', $ExceptionHandlerProvider);
|
2011-12-14 08:28:16 +00:00
|
|
|
});
|
|
|
|
|
inject(function($log, $exceptionHandler) {
|
|
|
|
|
$exceptionHandler('myError');
|
|
|
|
|
expect($log.error.logs.shift()).toEqual(['myError']);
|
|
|
|
|
});
|
|
|
|
|
});
|
2011-02-15 06:12:45 +00:00
|
|
|
|
|
|
|
|
|
2011-12-14 08:28:16 +00:00
|
|
|
it('should log errors with multiple arguments', function() {
|
|
|
|
|
module(function($provide){
|
2012-03-08 23:59:32 +00:00
|
|
|
$provide.provider('$exceptionHandler', $ExceptionHandlerProvider);
|
2011-12-14 08:28:16 +00:00
|
|
|
});
|
|
|
|
|
inject(function($log, $exceptionHandler) {
|
|
|
|
|
$exceptionHandler('myError', 'comment');
|
|
|
|
|
expect($log.error.logs.shift()).toEqual(['myError', 'comment']);
|
|
|
|
|
});
|
2012-01-12 19:06:10 +00:00
|
|
|
});
|
2011-02-15 06:12:45 +00:00
|
|
|
});
|