@@ -191,11 +191,16 @@ describe('PubSub', () => {
191191
192192 describe ( 'instantiation' , ( ) => {
193193 const maxMetadataSizeKey = 'grpc.max_metadata_size' ;
194+ const keepaliveTimeKey = 'grpc.keepalive_time_ms' ;
195+ const keepaliveTimeoutKey = 'grpc.keepalive_timeout_ms' ;
196+
194197 const DEFAULT_OPTIONS = {
195198 libName : 'gccl' ,
196199 libVersion : PKG . version ,
197200 scopes : [ ] ,
198201 [ maxMetadataSizeKey ] : 4 * 1024 * 1024 ,
202+ [ keepaliveTimeKey ] : 300000 ,
203+ [ keepaliveTimeoutKey ] : 20000 ,
199204 } ;
200205
201206 it ( 'should extend the correct methods' , ( ) => {
@@ -216,18 +221,24 @@ describe('PubSub', () => {
216221 assert ( new PubSub ( ) instanceof PubSub ) ;
217222 } ) ;
218223
219- it ( 'should augment the gRPC options for metadata size ' , ( ) => {
224+ it ( 'should augment the gRPC options' , ( ) => {
220225 let pubsub = new PubSub ( ) ;
221226 // eslint-disable-next-line @typescript-eslint/no-explicit-any
222227 let optionsAny : any = pubsub . options ;
223228 assert . strictEqual ( optionsAny [ maxMetadataSizeKey ] , 4 * 1024 * 1024 ) ;
229+ assert . strictEqual ( optionsAny [ keepaliveTimeKey ] , 300000 ) ;
230+ assert . strictEqual ( optionsAny [ keepaliveTimeoutKey ] , 20000 ) ;
224231
225232 optionsAny = {
226233 [ maxMetadataSizeKey ] : 1 * 1024 * 1024 ,
234+ [ keepaliveTimeKey ] : 30 ,
235+ [ keepaliveTimeoutKey ] : 100 ,
227236 } ;
228237 pubsub = new PubSub ( optionsAny ) ;
229238 optionsAny = pubsub . options ;
230239 assert . strictEqual ( optionsAny [ maxMetadataSizeKey ] , 1 * 1024 * 1024 ) ;
240+ assert . strictEqual ( optionsAny [ keepaliveTimeKey ] , 30 ) ;
241+ assert . strictEqual ( optionsAny [ keepaliveTimeoutKey ] , 100 ) ;
231242 } ) ;
232243
233244 it ( 'should combine all required scopes' , ( ) => {
0 commit comments