Skip to content

Commit 8a60354

Browse files
committed
test(win32): add expectations for errors not existing
1 parent 309ba61 commit 8a60354

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

test/kerberos_win32_tests.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const realm = process.env.KERBEROS_REALM;
1111
const hostname = process.env.KERBEROS_HOSTNAME;
1212
const username = `${process.env.KERBEROS_USERNAME}@${realm}`;
1313
const service = `mongodb/${hostname}`;
14-
const port = process.env.KERBEROS_POR || '27017';
14+
const port = process.env.KERBEROS_PORT || '27017';
1515
const upn = username;
1616

1717
function authenticate(options, callback) {
@@ -33,7 +33,11 @@ function authenticate(options, callback) {
3333

3434
if (start) {
3535
krbClient.step('', (err, payload) => {
36+
expect(err).to.not.exist;
37+
3638
db.command({ saslStart: 1, mechanism: 'GSSAPI', payload }, (err, dbResponse) => {
39+
expect(err).to.not.exist;
40+
3741
authenticate(
3842
{
3943
db,
@@ -89,7 +93,7 @@ describe('Kerberos (win32)', function() {
8993

9094
kerberos.initializeClient(
9195
service,
92-
{ user: username, domain: realm, password },
96+
{ user: username, password },
9397
(err, krbClient) => {
9498
expect(err).to.not.exist;
9599

@@ -144,7 +148,7 @@ describe('Kerberos (win32)', function() {
144148
const db = client.db('$external');
145149

146150
return kerberos
147-
.initializeClient(service, { user: username, domain: realm, password })
151+
.initializeClient(service, { user: username, password })
148152
.then(krbClient => {
149153
return authenticate({ db, krbClient, start: true }).then(authResponse => {
150154
return krbClient.unwrap(authResponse.challenge).then(unwrapped => {

0 commit comments

Comments
 (0)