@@ -12,7 +12,6 @@ import {
12
12
COSMOS_DB_MSG ,
13
13
DEFAULT_ALLOWED_HOSTS ,
14
14
DOCUMENT_DB_MSG ,
15
- FEATURE_FLAGS ,
16
15
type Log ,
17
16
MongoAPIError ,
18
17
MongoClient ,
@@ -748,43 +747,6 @@ describe('Connection String', function () {
748
747
} ) ;
749
748
} ) ;
750
749
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
-
788
750
describe ( 'IPv6 host addresses' , ( ) => {
789
751
it ( 'should not allow multiple unbracketed portless localhost IPv6 addresses' , ( ) => {
790
752
// 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 () {
874
836
} ) ;
875
837
876
838
describe ( 'when mongodbLogPath is in options' , function ( ) {
877
- const loggerFeatureFlag = __enableMongoLogger ;
878
-
879
839
let stderrStub ;
880
840
let stdoutStub ;
881
841
@@ -891,7 +851,7 @@ describe('Connection String', function () {
891
851
context ( 'when option is `stderr`' , function ( ) {
892
852
it ( 'it is accessible through mongoLogger.logDestination' , function ( ) {
893
853
const client = new MongoClient ( 'mongodb://a/?mongodbLogPath=stderr' , {
894
- [ loggerFeatureFlag ] : true
854
+ __enableMongoLogger : true
895
855
} ) ;
896
856
const log : Log = { t : new Date ( ) , c : 'ConnectionStringStdErr' , s : 'error' } ;
897
857
client . options . mongoLoggerOptions . logDestination . write ( log ) ;
@@ -903,7 +863,7 @@ describe('Connection String', function () {
903
863
context ( 'when option is `stdout`' , function ( ) {
904
864
it ( 'it is accessible through mongoLogger.logDestination' , function ( ) {
905
865
const client = new MongoClient ( 'mongodb://a/?mongodbLogPath=stdout' , {
906
- [ loggerFeatureFlag ] : true
866
+ __enableMongoLogger : true
907
867
} ) ;
908
868
const log : Log = { t : new Date ( ) , c : 'ConnectionStringStdOut' , s : 'error' } ;
909
869
client . options . mongoLoggerOptions . logDestination . write ( log ) ;
@@ -916,7 +876,7 @@ describe('Connection String', function () {
916
876
it ( 'should throw error at construction' , function ( ) {
917
877
expect (
918
878
( ) =>
919
- new MongoClient ( 'mongodb://a/?mongodbLogPath=stdnothing' , { [ loggerFeatureFlag ] : true } )
879
+ new MongoClient ( 'mongodb://a/?mongodbLogPath=stdnothing' , { __enableMongoLogger : true } )
920
880
) . to . throw ( MongoAPIError ) ;
921
881
} ) ;
922
882
} ) ;
@@ -931,7 +891,6 @@ describe('Connection String', function () {
931
891
process . env . MONGODB_LOG_CLIENT = undefined ;
932
892
} ) ;
933
893
934
- const loggerFeatureFlag = __enableMongoLogger ;
935
894
const test_cases = [
936
895
[ 'non-SRV example uri' , 'mongodb://a.example.com:27017,b.example.com:27017/' , '' ] ,
937
896
[ 'non-SRV default uri' , 'mongodb://a.mongodb.net:27017' , '' ] ,
@@ -960,7 +919,7 @@ describe('Connection String', function () {
960
919
}
961
920
} ;
962
921
new MongoClient ( uri , {
963
- [ loggerFeatureFlag ] : true ,
922
+ __enableMongoLogger : true ,
964
923
mongodbLogPath : stream
965
924
} ) ;
966
925
0 commit comments