Skip to content

Promise.coroutine should respect the arity of the generator function being wrapped? #927

Description

@renegare

Hi guys,

My use case is in the context of a cucumber-js step definition:

  this.Then(/^I should do (.+)$/, Promise.coroutine(function* (something) {
    expect(yield this.do(something)).to.be.true
  }))

Currently the above step when executed will return the following error from cucumber-js:

Error: step definition has 0 arguments, should have 1 (if synchronous or returning a promise) or 2 (if accepting a callback)

I appreciate this could be something cucumber-js should avoid throwing an error on or I solve it locally in my project, but I feel it would be a useful change within bluebird for all.

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions