@@ -15,7 +15,6 @@ import {
1515 type MongoOptions ,
1616 MongoParseError ,
1717 MongoRuntimeError ,
18- OPTIONS ,
1918 parseOptions ,
2019 resolveSRVRecord
2120} from '../mongodb' ;
@@ -726,36 +725,4 @@ describe('Connection String', function () {
726725 ] ) ;
727726 } ) ;
728727 } ) ;
729-
730- context ( 'default deprecated values' , ( ) => {
731- afterEach ( ( ) => sinon . restore ( ) ) ;
732- before ( 'ensure that `keepAlive` is deprecated' , ( ) => {
733- const { deprecated } = OPTIONS . keepAlive ;
734- expect ( deprecated ) . to . exist ;
735- } ) ;
736- context ( 'when no value is provided' , ( ) => {
737- it ( 'uses the default value' , ( ) => {
738- const options = parseOptions ( 'mongodb://localhost:27017' ) ;
739- expect ( options ) . to . have . property ( 'keepAlive' , true ) ;
740- } ) ;
741- it ( 'does not emit a deprecation warning' , async ( ) => {
742- const spy = sinon . spy ( process , 'emitWarning' ) ;
743- parseOptions ( 'mongodb://localhost:27017' ) ;
744- expect ( spy . called ) . to . be . false ;
745- } ) ;
746- } ) ;
747-
748- context ( 'when a value is provided' , ( ) => {
749- it ( 'uses the provided value' , ( ) => {
750- const options = parseOptions ( 'mongodb://localhost:27017?keepAlive=false' ) ;
751- expect ( options ) . to . have . property ( 'keepAlive' , false ) ;
752- } ) ;
753- it ( 'emits a deprecation warning' , async ( ) => {
754- const spy = sinon . spy ( process , 'emitWarning' ) ;
755- parseOptions ( 'mongodb://localhost:27017?keepAlive=false' ) ;
756- expect ( spy . called , 'expected a warning to be emitted, but none was' ) . to . be . true ;
757- expect ( spy . getCalls ( ) [ 0 ] . args [ 0 ] ) . to . match ( / k e e p A l i v e i s a d e p r e c a t e d o p t i o n / ) ;
758- } ) ;
759- } ) ;
760- } ) ;
761728} ) ;
0 commit comments