@@ -3,16 +3,15 @@ import { expect } from 'chai';
3
3
import * as crypto from 'crypto' ;
4
4
import * as sinon from 'sinon' ;
5
5
6
- // eslint-disable-next-line @typescript-eslint/no-restricted-imports
7
- import { StateMachine } from '../../../lib/client-side-encryption/state_machine' ;
8
6
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
9
7
import { ClientEncryption } from '../../../src/client-side-encryption/client_encryption' ;
10
8
import {
11
9
BSON ,
12
10
type Collection ,
13
11
type CommandStartedEvent ,
14
12
type MongoClient ,
15
- MongoOperationTimeoutError
13
+ MongoOperationTimeoutError ,
14
+ StateMachine
16
15
} from '../../mongodb' ;
17
16
import { type FailPoint , getEncryptExtraOptions } from '../../tools/utils' ;
18
17
@@ -479,16 +478,19 @@ describe('Client Side Encryption Functional', function () {
479
478
} ) ;
480
479
481
480
afterEach ( async function ( ) {
482
- await client . close ( ) ;
481
+ await client ? .close ( ) ;
483
482
} ) ;
484
483
485
484
describe ( 'rewrapManyDataKey' , function ( ) {
486
485
makeBlockingFailFor ( 'update' , 2000 ) ;
487
486
488
487
beforeEach ( async function ( ) {
489
- sinon . stub ( StateMachine . prototype , 'execute' ) . callsFake ( async function ( ) {
490
- return BSON . serialize ( { v : [ { _id : new UUID ( ) } ] } ) ;
491
- } ) ;
488
+ sinon
489
+ . stub ( StateMachine . prototype , 'execute' )
490
+ . callsFake ( async function ( executor , context , timeoutContext ) {
491
+ expect ( timeoutContext ) . to . have . property ( 'timeoutMS' , 500 ) ;
492
+ return BSON . serialize ( { v : [ { _id : new UUID ( ) } ] } ) ;
493
+ } ) ;
492
494
} ) ;
493
495
494
496
afterEach ( async function ( ) {
0 commit comments