99import { MongoClient , type Db } from 'mongodb' ;
1010import { mochaTestServer } from '@mongodb-js/compass-test-server' ;
1111
12- import { allBSONTypesWithEdgeCasesDoc } from '../all-bson-types-fixture' ;
12+ import { allValidBSONTypesWithEdgeCasesDoc } from '../all-bson-types-fixture' ;
1313import { analyzeDocuments } from '../../src' ;
1414
1515const bsonDocuments = [ {
@@ -134,8 +134,8 @@ describe('With a MongoDB Cluster', function() {
134134 const allTypesCollection = 'allTypes' ;
135135
136136 before ( async function ( ) {
137- await db . collection ( allTypesCollection ) . insertOne ( allBSONTypesWithEdgeCasesDoc ) ;
138- const docsFromCollection = await db . collection ( allTypesCollection ) . find ( ) . toArray ( ) ;
137+ await db . collection ( allTypesCollection ) . insertOne ( allValidBSONTypesWithEdgeCasesDoc ) ;
138+ const docsFromCollection = await db . collection ( allTypesCollection ) . find ( { } , { promoteValues : false } ) . toArray ( ) ;
139139
140140 // Create the schema validation rule.
141141 const analyzedDocuments = await analyzeDocuments ( docsFromCollection ) ;
@@ -150,12 +150,12 @@ describe('With a MongoDB Cluster', function() {
150150 } ) ;
151151 } ) ;
152152
153- it ( 'allows inserting valid documents (does not error)' , async function ( ) {
153+ it . only ( 'allows inserting valid documents (does not error)' , async function ( ) {
154154 const docs = [ {
155- ...allBSONTypesWithEdgeCasesDoc ,
155+ ...allValidBSONTypesWithEdgeCasesDoc ,
156156 _id : new ObjectId ( )
157157 } , {
158- ...allBSONTypesWithEdgeCasesDoc ,
158+ ...allValidBSONTypesWithEdgeCasesDoc ,
159159 _id : new ObjectId ( )
160160 } ] ;
161161
0 commit comments