Skip to content

Commit 2384e2e

Browse files
committed
chore: fix stub
1 parent 4f797c9 commit 2384e2e

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

test/unit/client-side-encryption/auto_encrypter.test.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,12 @@ describe('AutoEncrypter', function () {
6363
return Promise.resolve();
6464
});
6565

66-
sandbox.stub(StateMachine.prototype, 'fetchCollectionInfo').returns(
67-
(async function* () {
68-
while (true) yield MOCK_COLLINFO_RESPONSE;
69-
})()
70-
);
66+
const iterator = (async function* () {
67+
yield BSON.deserialize(MOCK_COLLINFO_RESPONSE);
68+
yield BSON.deserialize(MOCK_COLLINFO_RESPONSE);
69+
yield BSON.deserialize(MOCK_COLLINFO_RESPONSE);
70+
})();
71+
sandbox.stub(StateMachine.prototype, 'fetchCollectionInfo').returns(iterator);
7172

7273
sandbox.stub(StateMachine.prototype, 'markCommand').callsFake(() => {
7374
if (ENABLE_LOG_TEST) {

0 commit comments

Comments
 (0)