Skip to content

Connection event seems to trigger sync #29

Description

@topaxi

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).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions