blob: c6f131617eb84ae32ffb3919bcd9dc51bc408576 (
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
 | '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');
    $exceptionHandler('myError');
    expect($log.error.logs.shift()).toEqual(['myError']);
  });
});
 |