Skip to content

Commit ad2b018

Browse files
fix tests
1 parent ea73bc8 commit ad2b018

File tree

2 files changed

+1
-26
lines changed

2 files changed

+1
-26
lines changed

test/integration/auth/mongodb_aws.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ describe('AWS KMS Credential Fetching', function () {
340340
this.currentTest?.skipReason && this.skip();
341341
});
342342
it('fetching AWS KMS credentials throws an error', async function () {
343-
const error = await new KMSCredentialProvider({ aws: {} }).refreshCredentials().catch(e => e);
343+
const error = await refreshKMSCredentials({ aws: {} }).catch(e => e);
344344
expect(error).to.be.instanceOf(MongoAWSError);
345345
});
346346
});

test/unit/client-side-encryption/providers/credentialsProvider.test.ts

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -158,31 +158,6 @@ describe('#refreshKMSCredentials', function () {
158158
});
159159
});
160160

161-
context('when the sdk is not installed', function () {
162-
const kmsProviders = {
163-
local: {
164-
key: Buffer.alloc(96)
165-
},
166-
aws: {}
167-
};
168-
169-
before(function () {
170-
if (requirements.credentialProvidersInstalled.aws && this.currentTest) {
171-
this.currentTest.skipReason = 'Credentials will be loaded when sdk present';
172-
this.currentTest.skip();
173-
return;
174-
}
175-
});
176-
177-
it('throws a MongoAWSError', async function () {
178-
const error = await refreshKMSCredentials(kmsProviders).catch(e => e);
179-
const expectedErrorMessage = 'Optional module `@aws-sdk/credential-providers` not found';
180-
expect(error)
181-
.to.be.instanceOf(MongoAWSError)
182-
.to.match(new RegExp(expectedErrorMessage, 'i'));
183-
});
184-
});
185-
186161
context('when the AWS SDK returns unknown fields', function () {
187162
beforeEach(() => {
188163
sinon.stub(AWSSDKCredentialProvider.prototype, 'getCredentials').resolves({

0 commit comments

Comments
 (0)