Skip to content

Commit 9d938e4

Browse files
committed
test: comments
1 parent d04c6bd commit 9d938e4

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

test/integration/auth/auth.prose.test.ts

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ describe('Authentication Spec Prose Tests', function () {
203203
* the other mechanism fails.
204204
*/
205205
it(
206-
'fails to connect if incorrect auth mechanism is explicitly specified',
206+
'fails to connect if incorrect auth mechanism (SCRAM-SHA-1) is explicitly specified',
207207
metadata,
208208
async function () {
209209
const options = {
@@ -225,6 +225,29 @@ describe('Authentication Spec Prose Tests', function () {
225225
}
226226
);
227227

228+
it(
229+
'fails to connect if incorrect auth mechanism (SCRAM-SHA-256) is explicitly specified',
230+
metadata,
231+
async function () {
232+
const options = {
233+
auth: {
234+
username: userMap.sha1.username,
235+
password: userMap.sha1.password
236+
},
237+
authSource: 'admin',
238+
authMechanism: 'SCRAM-SHA-256'
239+
};
240+
241+
const client = this.configuration.newClient({}, options);
242+
const error = await client
243+
.db('test')
244+
.stats()
245+
.catch(e => e);
246+
expect(error.message).to.match(/Authentication failed|SCRAM/);
247+
await client.close();
248+
}
249+
);
250+
228251
/*
229252
* Step 3
230253
* For a non-existent username, verify that not specifying a mechanism when
@@ -276,7 +299,7 @@ describe('Authentication Spec Prose Tests', function () {
276299
);
277300

278301
it(
279-
'sends speculativeAuthenticate on initial handshake on MongoDB 4.4+',
302+
'sends speculativeAuthenticate on initial handshake on MongoDB',
280303
metadata,
281304
async function () {
282305
const options = {

0 commit comments

Comments
 (0)