Skip to content

Commit a55da8a

Browse files
committed
Add tests for error event when connecting Client
1 parent 57bd144 commit a55da8a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/integration/client/error-handling-tests.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ suite.test('when connecting to an invalid host with callback', function (done) {
151151
var client = new Client({
152152
user: 'very invalid username'
153153
})
154+
client.on('error', () => {
155+
assert.fail('unexpected error event when connecting')
156+
})
154157
client.connect(function (error, client) {
155158
assert(error instanceof Error)
156159
done()
@@ -161,6 +164,9 @@ suite.test('when connecting to invalid host with promise', function (done) {
161164
var client = new Client({
162165
user: 'very invalid username'
163166
})
167+
client.on('error', () => {
168+
assert.fail('unexpected error event when connecting')
169+
})
164170
client.connect().catch((e) => done())
165171
})
166172

0 commit comments

Comments
 (0)