Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.

Commit 53d6b36

Browse files
committed
Add test for connection refused issue
1 parent bc61f67 commit 53d6b36

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/client.test.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,3 +1463,17 @@ tap.test('resultError handling', function (t) {
14631463
t.fail('should not get error')
14641464
}
14651465
})
1466+
1467+
tap.test('connection refused', function (t) {
1468+
const client = ldap.createClient({
1469+
url: 'ldap://0.0.0.0'
1470+
})
1471+
1472+
client.bind('cn=root', 'secret', function (err, res) {
1473+
t.true(err)
1474+
t.type(err, Error)
1475+
t.equals(err.code, 'ECONNREFUSED')
1476+
t.false(res)
1477+
t.end()
1478+
})
1479+
})

0 commit comments

Comments
 (0)