Skip to content

Commit

Permalink
revert: Remove close event
Browse files Browse the repository at this point in the history
  • Loading branch information
Степан Логвин committed Nov 19, 2024
1 parent e9a22f2 commit 18c16da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/commands-utils/emitDisconnectEvent.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export default function emitConnectEvent(redisMock) {
process.nextTick(() => {
redisMock.emit('close')
redisMock.emit('end')
})
}
5 changes: 2 additions & 3 deletions test/integration/disconnect.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import Redis from 'ioredis'

describe('disconnect', () => {
it('should be available and emit "end" and "close" events', async () => {
it('should be available and emit "end" event', async () => {
const redis = new Redis({})
const events = []
redis.on('close', () => events.push('close'))
redis.on('end', () => events.push('end'))

expect(redis.disconnect()).toBe(undefined)

await new Promise(resolve => setImmediate(resolve));

expect(events).toEqual(['close', 'end'])
expect(events).toEqual(['end'])
})
})

0 comments on commit 18c16da

Please sign in to comment.