mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-17 07:40:22 +00:00
- split up services into files under src/service - split up specs into files under test/service - rewrite all specs so that they don't depend on one global forEach - get rid of obsolete code and tests in ng:switch - rename mock $log spec from "$log" to "$log mock"
23 lines
545 B
JavaScript
23 lines
545 B
JavaScript
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']);
|
|
});
|
|
});
|