Skip to content

Commit 9e29eff

Browse files
committed
fix: tests
1 parent 31e1327 commit 9e29eff

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

test/integration/auth/mongodb_aws.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,12 @@ describe('MONGODB-AWS', function () {
144144
this.skipReason = 'only relevant to AssumeRoleWithWebIdentity with SDK installed';
145145
return this.skip();
146146
}
147+
// If we have a username the credentials have been set from the URI, options, or environment
148+
// variables per the auth spec stated order.
149+
if (client.options.credentials.username) {
150+
this.skipReason = 'Credentials in the URI on env variables will not use custom provider.';
151+
return this.skip();
152+
}
147153
});
148154

149155
it('authenticates with a user provided credentials provider', async function () {
@@ -167,13 +173,7 @@ describe('MONGODB-AWS', function () {
167173

168174
expect(result).to.not.be.instanceOf(MongoServerError);
169175
expect(result).to.be.a('number');
170-
// If we have a username the credentials have been set from the URI, options, or environment
171-
// variables per the auth spec stated order.
172-
if (client.options.credentials.username) {
173-
expect(providerCount).to.equal(0);
174-
} else {
175-
expect(providerCount).to.be.greaterThan(0);
176-
}
176+
expect(providerCount).to.be.greaterThan(0);
177177
});
178178
});
179179

test/integration/client-side-encryption/client_side_encryption.prose.26.custom_aws_credential_providers.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ describe('26. Custom AWS Credential Providers', metadata, () => {
5353
},
5454
credentialProviders: { aws: credentialProvider.fromNodeProviderChain() }
5555
});
56-
}).to.throw(/custom credential provider and credentials/);
56+
}).to.throw(/Can only provide a custom AWS credential provider/);
5757
});
5858
}
5959
);
@@ -105,7 +105,7 @@ describe('26. Custom AWS Credential Providers', metadata, () => {
105105
credentialProviders: { aws: credentialProvider.fromNodeProviderChain() }
106106
}
107107
});
108-
}).to.throw(/custom credential provider and credentials/);
108+
}).to.throw(/Can only provide a custom AWS credential provider/);
109109
});
110110
}
111111
);

0 commit comments

Comments
 (0)