mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-17 07:40:22 +00:00
It registers a provider class, so this makes more sense. Breaks Rename $provide.service -> $provide.provider
24 lines
783 B
JavaScript
24 lines
783 B
JavaScript
'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']);
|
|
});
|
|
});
|
|
});
|