@@ -2296,6 +2296,7 @@ describe('store', function () {
22962296 } ) ;
22972297
22982298 describe ( 'fetchDocuments' , function ( ) {
2299+ const track = createNoopTrack ( ) ;
22992300 let findResult : unknown [ ] = [ ] ;
23002301 let csfleMode = 'disabled' ;
23012302 let find = sinon . stub ( ) . callsFake ( ( ) => {
@@ -2323,7 +2324,7 @@ describe('store', function () {
23232324 } ) ;
23242325
23252326 it ( 'should call find with $bsonSize projection when mongodb version is >= 4.4, not connected to ADF and csfle is disabled' , async function ( ) {
2326- await fetchDocuments ( dataService , '5.0.0' , false , 'test.test' , { } ) ;
2327+ await fetchDocuments ( dataService , track , '5.0.0' , false , 'test.test' , { } ) ;
23272328 expect ( find ) . to . have . been . calledOnce ;
23282329 expect ( find . getCall ( 0 ) )
23292330 . to . have . nested . property ( 'args.2.projection' )
@@ -2334,6 +2335,7 @@ describe('store', function () {
23342335 findResult = [ { __size : new Int32 ( 42 ) , __doc : { _id : 1 } } ] ;
23352336 const docs = await fetchDocuments (
23362337 dataService ,
2338+ track ,
23372339 '4.0.0' ,
23382340 false ,
23392341 'test.test' ,
@@ -2345,7 +2347,7 @@ describe('store', function () {
23452347 } ) ;
23462348
23472349 it ( 'should NOT call find with $bsonSize projection when mongodb version is < 4.4' , async function ( ) {
2348- await fetchDocuments ( dataService , '4.0.0' , false , 'test.test' , { } ) ;
2350+ await fetchDocuments ( dataService , track , '4.0.0' , false , 'test.test' , { } ) ;
23492351 expect ( find ) . to . have . been . calledOnce ;
23502352 expect ( find . getCall ( 0 ) ) . to . have . nested . property (
23512353 'args.2.projection' ,
@@ -2354,7 +2356,7 @@ describe('store', function () {
23542356 } ) ;
23552357
23562358 it ( 'should NOT call find with $bsonSize projection when connected to ADF' , async function ( ) {
2357- await fetchDocuments ( dataService , '5.0.0' , true , 'test.test' , { } ) ;
2359+ await fetchDocuments ( dataService , track , '5.0.0' , true , 'test.test' , { } ) ;
23582360 expect ( find ) . to . have . been . calledOnce ;
23592361 expect ( find . getCall ( 0 ) ) . to . have . nested . property (
23602362 'args.2.projection' ,
@@ -2364,7 +2366,7 @@ describe('store', function () {
23642366
23652367 it ( 'should NOT call find with $bsonSize projection when csfle is enabled' , async function ( ) {
23662368 csfleMode = 'enabled' ;
2367- await fetchDocuments ( dataService , '5.0.0' , false , 'test.test' , { } ) ;
2369+ await fetchDocuments ( dataService , track , '5.0.0' , false , 'test.test' , { } ) ;
23682370 expect ( find ) . to . have . been . calledOnce ;
23692371 expect ( find . getCall ( 0 ) ) . to . have . nested . property (
23702372 'args.2.projection' ,
@@ -2375,6 +2377,7 @@ describe('store', function () {
23752377 it ( 'should keep user projection when provided' , async function ( ) {
23762378 await fetchDocuments (
23772379 dataService ,
2380+ track ,
23782381 '5.0.0' ,
23792382 false ,
23802383 'test.test' ,
@@ -2399,6 +2402,7 @@ describe('store', function () {
23992402
24002403 const docs = await fetchDocuments (
24012404 dataService ,
2405+ track ,
24022406 '5.0.0' ,
24032407 false ,
24042408 'test.test' ,
@@ -2419,7 +2423,14 @@ describe('store', function () {
24192423 find = sinon . stub ( ) . rejects ( new TypeError ( '🤷♂️' ) ) ;
24202424
24212425 try {
2422- await fetchDocuments ( dataService , '5.0.0' , false , 'test.test' , { } ) ;
2426+ await fetchDocuments (
2427+ dataService ,
2428+ track ,
2429+ '5.0.0' ,
2430+ false ,
2431+ 'test.test' ,
2432+ { }
2433+ ) ;
24232434 expect . fail ( 'Expected fetchDocuments to fail with error' ) ;
24242435 } catch ( err ) {
24252436 expect ( find ) . to . have . been . calledOnce ;
@@ -2431,7 +2442,14 @@ describe('store', function () {
24312442 find = sinon . stub ( ) . rejects ( new MongoServerError ( 'Nope' ) ) ;
24322443
24332444 try {
2434- await fetchDocuments ( dataService , '3.0.0' , true , 'test.test' , { } ) ;
2445+ await fetchDocuments (
2446+ dataService ,
2447+ track ,
2448+ '3.0.0' ,
2449+ true ,
2450+ 'test.test' ,
2451+ { }
2452+ ) ;
24352453 expect . fail ( 'Expected fetchDocuments to fail with error' ) ;
24362454 } catch ( err ) {
24372455 expect ( find ) . to . have . been . calledOnce ;
0 commit comments