@@ -12,7 +12,6 @@ import {
1212 COSMOS_DB_MSG ,
1313 DEFAULT_ALLOWED_HOSTS ,
1414 DOCUMENT_DB_MSG ,
15- FEATURE_FLAGS ,
1615 type Log ,
1716 MongoAPIError ,
1817 MongoClient ,
@@ -748,43 +747,6 @@ describe('Connection String', function () {
748747 } ) ;
749748 } ) ;
750749
751- describe ( 'feature flags' , ( ) => {
752- it ( 'should be stored in the FEATURE_FLAGS Set' , ( ) => {
753- expect ( FEATURE_FLAGS . size ) . to . equal ( 3 ) ;
754- expect ( FEATURE_FLAGS . has ( __skipPingOnConnect ) ) . to . be . true ;
755- expect ( FEATURE_FLAGS . has ( __enableMongoLogger ) ) . to . be . true ;
756- expect ( FEATURE_FLAGS . has ( __internalLoggerConfig ) ) . to . be . true ;
757- // Add more flags here
758- } ) ;
759-
760- it ( 'should should ignore unknown symbols' , ( ) => {
761- const randomFlag = Symbol ( ) ;
762- const client = new MongoClient ( 'mongodb://iLoveJavaScript' , { [ randomFlag ] : 23n } ) ;
763- expect ( client . s . options ) . to . not . have . property ( randomFlag ) ;
764- } ) ;
765-
766- it ( 'should be prefixed with @@mdb.' , ( ) => {
767- for ( const flag of FEATURE_FLAGS ) {
768- expect ( flag ) . to . be . a ( 'symbol' ) ;
769- expect ( flag ) . to . have . property ( 'description' ) ;
770- expect ( flag . description ) . to . match ( / @ @ m d b \. .+ / ) ;
771- }
772- } ) ;
773-
774- it ( 'should only exist if specified on options' , ( ) => {
775- const flag = Array . from ( FEATURE_FLAGS ) [ 0 ] ; // grab a random supported flag
776- const client = new MongoClient ( 'mongodb://iLoveJavaScript' , { [ flag ] : true } ) ;
777- expect ( client . s . options ) . to . have . property ( flag , true ) ;
778- expect ( client . options ) . to . have . property ( flag , true ) ;
779- } ) ;
780-
781- it ( 'should support nullish values' , ( ) => {
782- const flag = Array . from ( FEATURE_FLAGS . keys ( ) ) [ 0 ] ; // grab a random supported flag
783- const client = new MongoClient ( 'mongodb://iLoveJavaScript' , { [ flag ] : null } ) ;
784- expect ( client . s . options ) . to . have . property ( flag , null ) ;
785- } ) ;
786- } ) ;
787-
788750 describe ( 'IPv6 host addresses' , ( ) => {
789751 it ( 'should not allow multiple unbracketed portless localhost IPv6 addresses' , ( ) => {
790752 // Note there is no "port-full" version of this test, there's no way to distinguish when a port begins without brackets
@@ -874,8 +836,6 @@ describe('Connection String', function () {
874836 } ) ;
875837
876838 describe ( 'when mongodbLogPath is in options' , function ( ) {
877- const loggerFeatureFlag = __enableMongoLogger ;
878-
879839 let stderrStub ;
880840 let stdoutStub ;
881841
@@ -891,7 +851,7 @@ describe('Connection String', function () {
891851 context ( 'when option is `stderr`' , function ( ) {
892852 it ( 'it is accessible through mongoLogger.logDestination' , function ( ) {
893853 const client = new MongoClient ( 'mongodb://a/?mongodbLogPath=stderr' , {
894- [ loggerFeatureFlag ] : true
854+ __enableMongoLogger : true
895855 } ) ;
896856 const log : Log = { t : new Date ( ) , c : 'ConnectionStringStdErr' , s : 'error' } ;
897857 client . options . mongoLoggerOptions . logDestination . write ( log ) ;
@@ -903,7 +863,7 @@ describe('Connection String', function () {
903863 context ( 'when option is `stdout`' , function ( ) {
904864 it ( 'it is accessible through mongoLogger.logDestination' , function ( ) {
905865 const client = new MongoClient ( 'mongodb://a/?mongodbLogPath=stdout' , {
906- [ loggerFeatureFlag ] : true
866+ __enableMongoLogger : true
907867 } ) ;
908868 const log : Log = { t : new Date ( ) , c : 'ConnectionStringStdOut' , s : 'error' } ;
909869 client . options . mongoLoggerOptions . logDestination . write ( log ) ;
@@ -916,7 +876,7 @@ describe('Connection String', function () {
916876 it ( 'should throw error at construction' , function ( ) {
917877 expect (
918878 ( ) =>
919- new MongoClient ( 'mongodb://a/?mongodbLogPath=stdnothing' , { [ loggerFeatureFlag ] : true } )
879+ new MongoClient ( 'mongodb://a/?mongodbLogPath=stdnothing' , { __enableMongoLogger : true } )
920880 ) . to . throw ( MongoAPIError ) ;
921881 } ) ;
922882 } ) ;
@@ -931,7 +891,6 @@ describe('Connection String', function () {
931891 process . env . MONGODB_LOG_CLIENT = undefined ;
932892 } ) ;
933893
934- const loggerFeatureFlag = __enableMongoLogger ;
935894 const test_cases = [
936895 [ 'non-SRV example uri' , 'mongodb://a.example.com:27017,b.example.com:27017/' , '' ] ,
937896 [ 'non-SRV default uri' , 'mongodb://a.mongodb.net:27017' , '' ] ,
@@ -960,7 +919,7 @@ describe('Connection String', function () {
960919 }
961920 } ;
962921 new MongoClient ( uri , {
963- [ loggerFeatureFlag ] : true ,
922+ __enableMongoLogger : true ,
964923 mongodbLogPath : stream
965924 } ) ;
966925
0 commit comments