File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1-
21export default function exception ( logger ) {
3- var service = {
4- catcher : catcher
2+ return {
3+ catcher
54 } ;
6- return service ;
75
86 function catcher ( message ) {
97 return function ( reason ) {
Original file line number Diff line number Diff line change 1+ describe ( 'exception' , ( ) => {
2+
3+ let exceptionInstance , loggerMock ;
4+
5+ beforeEach ( ( ) => {
6+ angular . mock . module ( function ( $provide ) {
7+ $provide . service ( 'logger' , function ( ) {
8+ this . error = jasmine . createSpy ( 'error' ) ;
9+ } ) ;
10+ } ) ;
11+
12+ angular . mock . module ( 'espackApp' ) ;
13+ } ) ;
14+
15+ describe ( '#ctor' , ( ) => {
16+
17+ beforeEach ( ( ) => {
18+ _inject ( ) ;
19+ } ) ;
20+
21+ it ( 'should exist' , ( ) => {
22+ expect ( ! ! exceptionInstance ) . toBe ( true ) ;
23+ } ) ;
24+
25+ it ( 'should define catcher property' , function ( ) {
26+
27+ expect ( exceptionInstance . catcher ) . toBeDefined ( ) ;
28+ expect ( typeof exceptionInstance . catcher ) . toBe ( 'function' ) ;
29+ } ) ;
30+
31+ } ) ;
32+
33+ function _inject ( ) {
34+ inject ( ( exception , logger ) => {
35+ loggerMock = logger ;
36+ exceptionInstance = exception ;
37+ } ) ;
38+ }
39+ } ) ;
You can’t perform that action at this time.
0 commit comments