Skip to content

Commit d29545d

Browse files
committed
adds test for handling swim error events
1 parent 3fefdd0 commit d29545d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,20 @@ test('move event', { timeout: 5000 }, (t) => {
156156
})
157157
})
158158

159+
test('error event', (t) => {
160+
t.plan(2)
161+
162+
const peer = hashring({
163+
joinTimeout: 10,
164+
base: ['0.0.0.0:7799']
165+
})
166+
.on('error', err => {
167+
t.ok(err instanceof Error)
168+
t.equal(err.name, 'JoinFailedError')
169+
peer.close()
170+
})
171+
})
172+
159173
test('client', (t) => {
160174
t.plan(4)
161175

0 commit comments

Comments
 (0)