timjroberts / cucumber-js-tsflow

Provides 'specflow' like bindings for Cucumber.js in TypeScript 1.7+.
MIT License
133 stars 34 forks source link

Only the first before and after function executed #109

Closed Tevek closed 1 year ago

Tevek commented 1 year ago

If you have to use multiple before and after methods within hooks it seems only the first before(), after() executed in Version 4.0.0-rc.9 regardless any tag

Below 4.0.0-rc.9 the before,after does not apply the HookOption as parameter so we are not able to use individual timeouts for each hook function

Fryuni commented 1 year ago

Hey @Tevek, thank you for reporting this issue!

I'm a bit confused so, to be clear, do you mean this?

@binding()
class Foo {
  @before()
  public beforeOne() {
    // This runs
  }

  @before()
  public beforeTwo() {
    // This doesn't
  }

  @after()
  public afterOne() {
    // This runs
  }

  @after()
  public afterTwo() {
    // This doesn't
  }
}

I don't get where timeouts play a role in what you are reporting, can you send a snippet of a case where it is breaking?

Tevek commented 1 year ago

Yes. correct beforeOne and afterOne run only

Timeout is a different issue do not deal with it

Fryuni commented 1 year ago

It took me a while to get to this, but I'd like to thank you again, @Tevek, because this shed some light on a deeper problem in our testing infrastructure.

I'm reworking all the tests to ensure they actually fail in case something stops working. This is one of the problems that will be fixed with this change.

I'll send updates here

Fryuni commented 1 year ago

This was fixed on 4.0.0-rc.11