9
9
import { MongoClient , type Db } from 'mongodb' ;
10
10
import { mochaTestServer } from '@mongodb-js/compass-test-server' ;
11
11
12
- import { allBSONTypesWithEdgeCasesDoc } from '../all-bson-types-fixture' ;
12
+ import { allValidBSONTypesWithEdgeCasesDoc } from '../all-bson-types-fixture' ;
13
13
import { analyzeDocuments } from '../../src' ;
14
14
15
15
const bsonDocuments = [ {
@@ -134,8 +134,8 @@ describe('With a MongoDB Cluster', function() {
134
134
const allTypesCollection = 'allTypes' ;
135
135
136
136
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 ( ) ;
139
139
140
140
// Create the schema validation rule.
141
141
const analyzedDocuments = await analyzeDocuments ( docsFromCollection ) ;
@@ -150,12 +150,12 @@ describe('With a MongoDB Cluster', function() {
150
150
} ) ;
151
151
} ) ;
152
152
153
- it ( 'allows inserting valid documents (does not error)' , async function ( ) {
153
+ it . only ( 'allows inserting valid documents (does not error)' , async function ( ) {
154
154
const docs = [ {
155
- ...allBSONTypesWithEdgeCasesDoc ,
155
+ ...allValidBSONTypesWithEdgeCasesDoc ,
156
156
_id : new ObjectId ( )
157
157
} , {
158
- ...allBSONTypesWithEdgeCasesDoc ,
158
+ ...allValidBSONTypesWithEdgeCasesDoc ,
159
159
_id : new ObjectId ( )
160
160
} ] ;
161
161
0 commit comments