Files
angular.js/test/ng/exceptionHandlerSpec.js
Henry Zhu 7f65f97919 style(*): add rule requireSpacesInFunction beforeOpeningCurlyBrace
This rule enforces a space after the curly brace
for function declarations, anonymous function expressions,
and named function expressions.
2014-10-23 15:59:25 -04:00

26 lines
796 B
JavaScript

'use strict';
describe('$exceptionHandler', function() {
/* global $ExceptionHandlerProvider:false */
it('should log errors with single argument', function() {
module(function($provide) {
$provide.provider('$exceptionHandler', $ExceptionHandlerProvider);
});
inject(function($log, $exceptionHandler) {
$exceptionHandler('myError');
expect($log.error.logs.shift()).toEqual(['myError']);
});
});
it('should log errors with multiple arguments', function() {
module(function($provide) {
$provide.provider('$exceptionHandler', $ExceptionHandlerProvider);
});
inject(function($log, $exceptionHandler) {
$exceptionHandler('myError', 'comment');
expect($log.error.logs.shift()).toEqual(['myError', 'comment']);
});
});
});