Add test for connection refused issue

This commit is contained in:
Thomas P 2019-10-11 22:55:48 +02:00
parent bc61f67b12
commit 53d6b36bb2
No known key found for this signature in database
GPG Key ID: 722E1405F9F15F5E
1 changed files with 14 additions and 0 deletions

View File

@ -1463,3 +1463,17 @@ tap.test('resultError handling', function (t) {
t.fail('should not get error')
}
})
tap.test('connection refused', function (t) {
const client = ldap.createClient({
url: 'ldap://0.0.0.0'
})
client.bind('cn=root', 'secret', function (err, res) {
t.true(err)
t.type(err, Error)
t.equals(err.code, 'ECONNREFUSED')
t.false(res)
t.end()
})
})