-
-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Description
Given something like:
let srv = Mitm()
let client = irc.Client.create({
host: 'irc.example.com',
port: 6667,
nick: 'topaxi',
user: 'topaxi'
})
let subscription = client.subscribe()
srv.on('connection', () => {
subscription.unsubscribe()
srv.disable()
done()
})The subscription will be undefined in the connection event, this makes it kinda hard to write tests without introducing manual process.nextTick(...) calls.
I've tried putting the subscribe() call below the 'connection' event, but this won't work as connection will be triggered inside my subscribe call (because Mitm seems to make this sync).
Metadata
Metadata
Assignees
Labels
No labels