mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-18 15:50:22 +00:00
24 lines
545 B
JavaScript
24 lines
545 B
JavaScript
|
|
describe('$exceptionHandler', function() {
|
||
|
|
var scope;
|
||
|
|
|
||
|
|
beforeEach(function(){
|
||
|
|
scope = angular.scope();
|
||
|
|
});
|
||
|
|
|
||
|
|
|
||
|
|
afterEach(function(){
|
||
|
|
dealoc(scope);
|
||
|
|
});
|
||
|
|
|
||
|
|
|
||
|
|
it('should log errors', function(){
|
||
|
|
var scope = createScope({}, {$exceptionHandler: $exceptionHandlerFactory},
|
||
|
|
{$log: $logMock}),
|
||
|
|
$log = scope.$service('$log'),
|
||
|
|
$exceptionHandler = scope.$service('$exceptionHandler');
|
||
|
|
|
||
|
|
$exceptionHandler('myError');
|
||
|
|
expect($log.error.logs.shift()).toEqual(['myError']);
|
||
|
|
});
|
||
|
|
});
|