Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event emitters don't seem to be working #4

Open
tandrewnichols opened this issue Aug 11, 2014 · 8 comments
Open

Event emitters don't seem to be working #4

tandrewnichols opened this issue Aug 11, 2014 · 8 comments
Labels

Comments

@tandrewnichols
Copy link
Contributor

Does this look correct? (next is from async.each)

    stairs = new Stairs()
    stairs
      .step("#{env}: #{options._name}", actions[options._name])
      .step("#{env}: bump", !options.bump, utils.bump)
      .step("#{env}: write", options.dryRun, utils.write)
      .run.apply(stairs, [options].concat(args).concat(env))
      .on('error', -> console.log '1 error'; next())
      .on('done', -> console.log '1 done'; next())

Neither of the on handlers are logging anything, and the tests fail, so presumably, the events are not firing correctly . . . or I'm setting this up wrong.

Also tried it with

    stairs = new Stairs()
    stairs
      .step("#{env}: #{options._name}", actions[options._name])
      .step("#{env}: bump", !options.bump, utils.bump)
      .step("#{env}: write", options.dryRun, utils.write)
      .run.apply(stairs, [options].concat(args).concat(env))
    stairs.on('error', -> console.log '1 error'; next())
    stairs.on('done', -> console.log '1 done'; next())
@NathanGRomano
Copy link
Member

Which version are you on. I think I had found an issue and published it. v0.1.1

@tandrewnichols
Copy link
Contributor Author

I'll double check, but I had just installed it with npm install stairs --save, so it should've been the latest.

@tandrewnichols
Copy link
Contributor Author

I'm on 0.3.0.

@NathanGRomano
Copy link
Member

You still have the problem?

@NathanGRomano
Copy link
Member

How about binding the handlers before calling run?

@NathanGRomano
Copy link
Member

on is also chain able

stairs()
.on('error', function (...) {})
.step('blah', function (...) { })
.on('step', function () {...}).run(...);

@tandrewnichols
Copy link
Contributor Author

I think I tried that too, but I'm not positive, so I'll try it again.

@NathanGRomano
Copy link
Member

Are you still having issues?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants