@@ -17,26 +17,28 @@ describe('ClientGrpcProxy', () => {
1717
1818 beforeEach ( ( ) => {
1919 client = new ClientGrpcProxy ( {
20- options : {
21- protoPath : join ( __dirname , './test.proto' ) ,
22- package : 'test' ,
23- } ,
20+ protoPath : join ( __dirname , './test.proto' ) ,
21+ package : 'test' ,
2422 } ) ;
2523 } ) ;
2624
2725 describe ( 'getService' , ( ) => {
2826 describe ( 'when "grpcClient[name]" is nil' , ( ) => {
2927 it ( 'should throw "InvalidGrpcServiceException"' , ( ) => {
3028 ( client as any ) . grpcClient = { } ;
31- expect ( ( ) => client . getService ( 'test' ) ) . to . throw ( InvalidGrpcServiceException ) ;
29+ expect ( ( ) => client . getService ( 'test' ) ) . to . throw (
30+ InvalidGrpcServiceException ,
31+ ) ;
3232 } ) ;
3333 } ) ;
3434 describe ( 'when "grpcClient[name]" is not nil' , ( ) => {
3535 it ( 'should create grpcService' , ( ) => {
3636 ( client as any ) . grpcClient = {
3737 test : GrpcService ,
3838 } ;
39- expect ( ( ) => client . getService ( 'test' ) ) . to . not . throw ( InvalidGrpcServiceException ) ;
39+ expect ( ( ) => client . getService ( 'test' ) ) . to . not . throw (
40+ InvalidGrpcServiceException ,
41+ ) ;
4042 } ) ;
4143 } ) ;
4244 } ) ;
@@ -90,11 +92,11 @@ describe('ClientGrpcProxy', () => {
9092 const methodName = 'm' ;
9193 type EvtCallback = ( ...args : any [ ] ) => void ;
9294 let callMock : {
93- on : ( type : string , fn : EvtCallback ) => void ,
94- cancel : sinon . SinonSpy ,
95- finished : boolean ,
96- destroy : sinon . SinonSpy ,
97- removeAllListeners : sinon . SinonSpy ,
95+ on : ( type : string , fn : EvtCallback ) => void ;
96+ cancel : sinon . SinonSpy ;
97+ finished : boolean ;
98+ destroy : sinon . SinonSpy ;
99+ removeAllListeners : sinon . SinonSpy ;
98100 } ;
99101 let eventCallbacks : { [ type : string ] : EvtCallback } ;
100102 let obj ;
@@ -110,7 +112,7 @@ describe('ClientGrpcProxy', () => {
110112 completeSpy . reset ( ) ;
111113 eventCallbacks = { } ;
112114 callMock = {
113- on : ( type , fn ) => eventCallbacks [ type ] = fn ,
115+ on : ( type , fn ) => ( eventCallbacks [ type ] = fn ) ,
114116 cancel : sinon . spy ( ) ,
115117 finished : false ,
116118 destroy : sinon . spy ( ) ,
@@ -149,9 +151,11 @@ describe('ClientGrpcProxy', () => {
149151 eventCallbacks . data ( 'c' ) ;
150152
151153 expect ( callMock . cancel . called , 'should call call.cancel()' ) . to . be . true ;
152- expect ( callMock . destroy . called , 'should call call.destroy()' ) . to . be . true ;
154+ expect ( callMock . destroy . called , 'should call call.destroy()' ) . to . be
155+ . true ;
153156 expect ( dataSpy . args ) . to . eql ( [ [ 'a' ] , [ 'b' ] ] ) ;
154- expect ( errorSpy . called , 'should not error if client canceled' ) . to . be . false ;
157+ expect ( errorSpy . called , 'should not error if client canceled' ) . to . be
158+ . false ;
155159 } ) ;
156160 } ) ;
157161 } ) ;
@@ -163,7 +167,7 @@ describe('ClientGrpcProxy', () => {
163167 } ) ;
164168 describe ( 'on subscribe' , ( ) => {
165169 const methodName = 'm' ;
166- const obj = { [ methodName ] : ( callback ) => callback ( null , { } ) } ;
170+ const obj = { [ methodName ] : callback => callback ( null , { } ) } ;
167171
168172 let stream$ : Observable < any > ;
169173
@@ -184,7 +188,9 @@ describe('ClientGrpcProxy', () => {
184188 describe ( 'when package does not exist' , ( ) => {
185189 it ( 'should throw "InvalidGrpcPackageException"' , ( ) => {
186190 sinon . stub ( client , 'lookupPackage' ) . callsFake ( ( ) => null ) ;
187- expect ( ( ) => client . createClient ( ) ) . to . throw ( InvalidGrpcPackageException ) ;
191+ expect ( ( ) => client . createClient ( ) ) . to . throw (
192+ InvalidGrpcPackageException ,
193+ ) ;
188194 } ) ;
189195 } ) ;
190196 } ) ;
@@ -195,7 +201,9 @@ describe('ClientGrpcProxy', () => {
195201 sinon . stub ( client , 'getOptionsProp' ) . callsFake ( ( ) => {
196202 throw new Error ( ) ;
197203 } ) ;
198- expect ( ( ) => client . loadProto ( ) ) . to . throws ( InvalidProtoDefinitionException ) ;
204+ expect ( ( ) => client . loadProto ( ) ) . to . throws (
205+ InvalidProtoDefinitionException ,
206+ ) ;
199207 } ) ;
200208 } ) ;
201209 } ) ;
0 commit comments