Skip to content

Commit

Permalink
test(NODE-2938): minor test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
durran committed Feb 9, 2022
1 parent d51e903 commit f0acf9c
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions test/manual/kerberos.test.js
Expand Up @@ -97,18 +97,21 @@ describe('Kerberos', function () {
});
});

context('when passsing SERVICE_HOST', function () {
context('when passing SERVICE_HOST as an auth mech option', function () {
context('when the SERVICE_HOST is invalid', function () {
const client = new MongoClient(`${krb5Uri}&maxPoolSize=1`, {
authMechanismProperties: {
SERVICE_HOST: 'example.com'
}
});

it('fails to authenticate', function () {
return client.connect().catch(e => {
expect(e).to.exist;
});
it('fails to authenticate', async function () {
let expectedError;
await client.connect().catch(e => { expectedError = e });
if (!expectedError) {
expect.fail('Expected connect with invalid SERVICE_HOST to fail');
}
expect(expectedError).property('message').to.include('Authentication failed');
});
});

Expand Down

0 comments on commit f0acf9c

Please sign in to comment.