@@ -30,8 +30,8 @@ describe('MaxTimeMS', function () {
30
30
const col = client . db ( ) . collection ( 'max_time_ms' ) ;
31
31
await col . insertMany ( [ { agg_pipe : 1 } ] , { writeConcern : { w : 1 } } ) ;
32
32
const cursor = col . find ( { $where : 'sleep(100) || true' } ) . maxTimeMS ( 50 ) ;
33
- const kBuiltOptions = getSymbolFrom ( cursor , 'builtOptions' ) ;
34
- expect ( cursor [ kBuiltOptions ] ) . to . have . property ( 'maxTimeMS' , 50 ) ;
33
+ // @ts -expect-error: findOptions are private
34
+ expect ( cursor . findOptions ) . to . have . property ( 'maxTimeMS' , 50 ) ;
35
35
36
36
const error = await cursor . count ( ) . catch ( error => error ) ;
37
37
expect ( error ) . to . be . instanceOf ( MongoServerError ) ;
@@ -44,8 +44,8 @@ describe('MaxTimeMS', function () {
44
44
const col = client . db ( ) . collection ( 'max_time_ms' ) ;
45
45
await col . insertMany ( [ { agg_pipe : 1 } ] , { writeConcern : { w : 1 } } ) ;
46
46
const cursor = col . find ( { $where : 'sleep(100) || true' } ) . maxTimeMS ( 50 ) ;
47
- const kBuiltOptions = getSymbolFrom ( cursor , 'builtOptions' ) ;
48
- expect ( cursor [ kBuiltOptions ] ) . to . have . property ( 'maxTimeMS' , 50 ) ;
47
+ // @ts -expect-error: findOptions are private
48
+ expect ( cursor . findOptions ) . to . have . property ( 'maxTimeMS' , 50 ) ;
49
49
50
50
const error = await cursor . toArray ( ) . catch ( error => error ) ;
51
51
expect ( error ) . to . be . instanceOf ( MongoServerError ) ;
0 commit comments