blob: 61e652b5278eb73320a695fce4fd91f72a3350fa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
'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']);
});
});
|