File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
modules/express/test/unit Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -601,5 +601,45 @@ describe('Bitgo Express', function () {
601601
602602 createServerStub . restore ( ) ;
603603 } ) ;
604+
605+ it ( 'should not set keepAliveTimeout and headersTimeout if not specified in config for HTTP server' , async function ( ) {
606+ const createServerStub = sinon . stub ( http , 'createServer' ) . callsFake ( ( ) => {
607+ return { listen : sinon . stub ( ) , setTimeout : sinon . stub ( ) } as unknown as http . Server ;
608+ } ) ;
609+
610+ const args : any = {
611+ env : 'test' ,
612+ bind : 'localhost' ,
613+ // keepAliveTimeout and headersTimeout are not specified
614+ } ;
615+
616+ const server = await createServer ( args , null as any ) ;
617+
618+ should ( server . keepAliveTimeout ) . be . undefined ( ) ;
619+ should ( server . headersTimeout ) . be . undefined ( ) ;
620+
621+ createServerStub . restore ( ) ;
622+ } ) ;
623+
624+ it ( 'should not set keepAliveTimeout and headersTimeout if not specified in config for HTTPS server' , async function ( ) {
625+ const createServerStub = sinon . stub ( https , 'createServer' ) . callsFake ( ( ) => {
626+ return { listen : sinon . stub ( ) , setTimeout : sinon . stub ( ) } as unknown as https . Server ;
627+ } ) ;
628+
629+ const args : any = {
630+ env : 'test' ,
631+ bind : 'localhost' ,
632+ sslKey : 'ssl-key' ,
633+ sslCert : 'ssl-cert' ,
634+ // keepAliveTimeout and headersTimeout are not specified
635+ } ;
636+
637+ const server = await createServer ( args , null as any ) ;
638+
639+ should ( server . keepAliveTimeout ) . be . undefined ( ) ;
640+ should ( server . headersTimeout ) . be . undefined ( ) ;
641+
642+ createServerStub . restore ( ) ;
643+ } ) ;
604644 } ) ;
605645} ) ;
You can’t perform that action at this time.
0 commit comments