mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-16 23:30:23 +00:00
26 lines
587 B
JavaScript
26 lines
587 B
JavaScript
'use strict';
|
|
|
|
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');
|
|
|
|
$log.error.rethrow = false;
|
|
$exceptionHandler('myError');
|
|
expect($log.error.logs.shift()).toEqual(['myError']);
|
|
});
|
|
});
|