Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
W-A-James committed Jan 23, 2025
1 parent 9b941b6 commit 979e021
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions test/integration/auth/mongodb_aws.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ describe('MONGODB-AWS', function () {
options: CommandOptions,
responseType?: MongoDBResponseConstructor
) {
if (command.saslContinue != null) {
saslContinue = { ...command };
}

const result = await commandStub.wrappedMethod.call(
this,
ns,
Expand All @@ -96,22 +100,18 @@ describe('MONGODB-AWS', function () {
responseType
);

if (command.saslStart != null && command.mechanism === 'MONGODB-AWS') {
if (command.saslStart != null) {
// Modify the result of the saslStart to check if the saslContinue uses it
result.conversationId = 999;
saslStartResult = { ...result };
}

if (command.saslContinue != null) {
console.log('saving saslContinue');
saslContinue = { ...command };
}

return result;
});
});

afterEach(function () {
commandStub.restore();
sinon.restore();
});

Expand All @@ -123,7 +123,6 @@ describe('MONGODB-AWS', function () {
.collection('aws_test')
.estimatedDocumentCount()
.catch(e => e);
console.log(err);

// Expecting the saslContinue to fail since we changed the conversationId
expect(err).to.be.instanceof(MongoServerError);
Expand Down

0 comments on commit 979e021

Please sign in to comment.