Skip to content

Commit b9f5b23

Browse files
committed
chore: fix sinon
1 parent 6576b99 commit b9f5b23

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

test/integration/client-side-encryption/driver.test.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,15 @@ import { expect } from 'chai';
33
import * as crypto from 'crypto';
44
import * as sinon from 'sinon';
55

6-
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
7-
import { StateMachine } from '../../../lib/client-side-encryption/state_machine';
86
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
97
import { ClientEncryption } from '../../../src/client-side-encryption/client_encryption';
108
import {
119
BSON,
1210
type Collection,
1311
type CommandStartedEvent,
1412
type MongoClient,
15-
MongoOperationTimeoutError
13+
MongoOperationTimeoutError,
14+
StateMachine
1615
} from '../../mongodb';
1716
import { type FailPoint, getEncryptExtraOptions } from '../../tools/utils';
1817

@@ -479,16 +478,19 @@ describe('Client Side Encryption Functional', function () {
479478
});
480479

481480
afterEach(async function () {
482-
await client.close();
481+
await client?.close();
483482
});
484483

485484
describe('rewrapManyDataKey', function () {
486485
makeBlockingFailFor('update', 2000);
487486

488487
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+
});
492494
});
493495

494496
afterEach(async function () {

test/mongodb.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,16 @@ export * from '../src/bulk/common';
103103
export * from '../src/bulk/ordered';
104104
export * from '../src/bulk/unordered';
105105
export * from '../src/change_stream';
106+
export * from '../src/client-side-encryption/auto_encrypter';
107+
export * from '../src/client-side-encryption/client_encryption';
108+
export * from '../src/client-side-encryption/crypto_callbacks';
109+
export * from '../src/client-side-encryption/errors';
110+
export * from '../src/client-side-encryption/mongocryptd_manager';
111+
export * from '../src/client-side-encryption/providers/aws';
112+
export * from '../src/client-side-encryption/providers/azure';
113+
export * from '../src/client-side-encryption/providers/gcp';
114+
export * from '../src/client-side-encryption/providers/index';
115+
export * from '../src/client-side-encryption/state_machine';
106116
export * from '../src/cmap/auth/auth_provider';
107117
export * from '../src/cmap/auth/aws_temporary_credentials';
108118
export * from '../src/cmap/auth/gssapi';

0 commit comments

Comments
 (0)