Skip to content
Prev Previous commit
Next Next commit
chore: fix stub
  • Loading branch information
nbbeeken committed Feb 26, 2025
commit e7ec664107047e8993f1d2c6e30dfb10769f2aa9
11 changes: 6 additions & 5 deletions test/unit/client-side-encryption/auto_encrypter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,12 @@ describe('AutoEncrypter', function () {
return Promise.resolve();
});

sandbox.stub(StateMachine.prototype, 'fetchCollectionInfo').returns(
(async function* () {
while (true) yield MOCK_COLLINFO_RESPONSE;
})()
);
const iterator = (async function* () {
yield BSON.deserialize(MOCK_COLLINFO_RESPONSE);
yield BSON.deserialize(MOCK_COLLINFO_RESPONSE);
yield BSON.deserialize(MOCK_COLLINFO_RESPONSE);
})();
sandbox.stub(StateMachine.prototype, 'fetchCollectionInfo').returns(iterator);

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