Update everything
This commit is contained in:
parent
bf368181a4
commit
72a485d6e8
319 changed files with 67958 additions and 13948 deletions
32
lib/angular/docs/partials/api/ngMock.$exceptionHandler.html
Normal file
32
lib/angular/docs/partials/api/ngMock.$exceptionHandler.html
Normal file
|
@ -0,0 +1,32 @@
|
|||
<h1><code ng:non-bindable="">$exceptionHandler</code>
|
||||
<span class="hint">(service in module <code ng:non-bindable="">ngMock</code>
|
||||
)</span>
|
||||
</h1>
|
||||
<div><h2 id="Description">Description</h2>
|
||||
<div class="description"><p>Mock implementation of <a href="api/ng.$exceptionHandler"><code>ng.$exceptionHandler</code></a> that rethrows or logs errors passed
|
||||
into it. See <a href="api/ngMock.$exceptionHandlerProvider">$exceptionHandlerProvider</a> for configuration
|
||||
information.</p>
|
||||
|
||||
<pre class="prettyprint linenums">
|
||||
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]]);
|
||||
});
|
||||
});
|
||||
});
|
||||
</pre></div>
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue