EVOLUTION-MANAGER
Edit File: $exceptionHandler.html
<a href='https://github.com/angular/angular.js/edit/v1.3.x/src/ngMock/angular-mocks.js?message=docs($exceptionHandler)%3A%20describe%20your%20change...#L200' class='improve-docs btn btn-primary'><i class="glyphicon glyphicon-edit"> </i>Improve this Doc</a> <a href='https://github.com/angular/angular.js/tree/v1.3.9/src/ngMock/angular-mocks.js#L200' class='view-source pull-right btn btn-primary'> <i class="glyphicon glyphicon-zoom-in"> </i>View Source </a> <header class="api-profile-header"> <h1 class="api-profile-header-heading">$exceptionHandler</h1> <ol class="api-profile-header-structure naked-list step-list"> <li> <a href="api/ngMock/provider/$exceptionHandlerProvider">- $exceptionHandlerProvider</a> </li> <li> - service in module <a href="api/ngMock">ngMock</a> </li> </ol> </header> <div class="api-profile-description"> <p>Mock implementation of <a href="api/ng/service/$exceptionHandler"><code>$exceptionHandler</code></a> that rethrows or logs errors passed to it. See <a href="api/ngMock/provider/$exceptionHandlerProvider">$exceptionHandlerProvider</a> for configuration information.</p> <pre><code class="lang-js">describe('$exceptionHandlerProvider', function() { it('should capture log messages and exceptions', function() { module(function($exceptionHandlerProvider) { $exceptionHandlerProvider.mode('log'); }); inject(function($log, $exceptionHandler, $timeout) { $timeout(function() { $log.log(1); }); $timeout(function() { $log.log(2); throw 'banana peel'; }); $timeout(function() { $log.log(3); }); expect($exceptionHandler.errors).toEqual([]); expect($log.assertEmpty()); $timeout.flush(); expect($exceptionHandler.errors).toEqual(['banana peel']); expect($log.log.logs).toEqual([[1], [2], [3]]); }); }); }); </code></pre> </div> <div> </div>