@@ -72,7 +72,7 @@ describe('grpc', () => {
7272 'X-Goog-Api-Client' : 'gl-node/6.6.0 gccl/0.7.0 gax/0.11.0 grpc/1.1.0' ,
7373 } ;
7474 const builder = grpcClient . metadataBuilder ( headers ) ;
75- const abTesting = null ;
75+ const abTesting : { } | null = null ;
7676 const moreHeaders = { foo : 'bar' } ;
7777 const metadata = builder ( abTesting ! , moreHeaders ) ;
7878 assert . deepStrictEqual ( metadata . get ( 'foo' ) , [ 'bar' ] ) ;
@@ -85,7 +85,7 @@ describe('grpc', () => {
8585 'X-Goog-Api-Client' : 'gl-node/6.6.0 gccl/0.7.0 gax/0.11.0 grpc/1.1.0' ,
8686 } ;
8787 const builder = grpcClient . metadataBuilder ( headers ) ;
88- const abTesting = null ;
88+ const abTesting : { } | null = null ;
8989 const moreHeaders = { 'x-GOOG-api-CLIENT' : 'something else' } ;
9090 const metadata = builder ( abTesting ! , moreHeaders ) ;
9191 assert . deepStrictEqual ( metadata . get ( 'x-goog-api-client' ) , [
@@ -117,7 +117,11 @@ describe('grpc', () => {
117117
118118 describe ( 'createStub' , ( ) => {
119119 class DummyStub {
120- constructor ( public address : { } , public creds : { } , public options : { } ) { }
120+ constructor (
121+ public address : { } ,
122+ public creds : { } ,
123+ public options : { [ index : string ] : string | number | Function }
124+ ) { }
121125 }
122126 let grpcClient : GrpcClient ;
123127 const dummyChannelCreds = { channelCreds : 'dummyChannelCreds' } ;
@@ -195,11 +199,15 @@ describe('grpc', () => {
195199 assert ( stub . options . hasOwnProperty ( k ) ) ;
196200 } ) ;
197201 // check values
202+ const dummyStub = ( stub as unknown ) as DummyStub ;
198203 assert . strictEqual (
199- stub . options [ 'grpc.max_send_message_length' ] ,
204+ dummyStub . options [ 'grpc.max_send_message_length' ] ,
200205 10 * 1024 * 1024
201206 ) ;
202- assert . strictEqual ( stub . options [ 'callInvocationTransformer' ] ( ) , 42 ) ;
207+ assert . strictEqual (
208+ ( dummyStub . options [ 'callInvocationTransformer' ] as Function ) ( ) ,
209+ 42
210+ ) ;
203211 [ 'servicePath' , 'port' , 'other_dummy_options' ] . forEach ( k => {
204212 assert . strictEqual ( stub . options . hasOwnProperty ( k ) , false ) ;
205213 } ) ;
@@ -241,8 +249,9 @@ describe('grpc', () => {
241249 [ 'servicePath' , 'port' ] . forEach ( k => {
242250 assert . strictEqual ( stub . options . hasOwnProperty ( k ) , false ) ;
243251 } ) ;
252+ const dummyStub = ( stub as unknown ) as DummyStub ;
244253 assert . strictEqual (
245- stub . options [ 'grpc.max_receive_message_length' ] ,
254+ dummyStub . options [ 'grpc.max_receive_message_length' ] ,
246255 10 * 1024 * 1024
247256 ) ;
248257 } ) ;
0 commit comments