You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{Then,World}from'@cucumber/cucumber';Then('the test runs with string parameter {string}',asyncfunction(this: World,parameter: string){this.driver.close()})
I could not find any mention of this in the docs. Further, 20m of code surfing, and I couldn't even find where this is actually happening.
If this an official API? This changes things quite a bit as it unlocks the use of arrow functions.
We would like our world to be typed, and right now this is the only way to do this. So we need insurance this API is official.
The text was updated successfully, but these errors were encountered:
Unfortunately the limitation of arrow functions is unchanged. You might consider trying https://github.com/jbpros/cucumber-fp for an approach that skirts the this issue.
We would like our world to be typed, and right now this is the only way to do this. So we need insurance this API is official.
To answer this specifically: yes if you're using TypeScript then whatever class you pass to setWorldConstructor you can use as the this arg on step/hook functions and you should get the type safety you need.
In #1667 (comment) the proposed solution by @davidjgoss is:
I could not find any mention of this in the docs. Further, 20m of code surfing, and I couldn't even find where this is actually happening.
If this an official API? This changes things quite a bit as it unlocks the use of arrow functions.
We would like our world to be typed, and right now this is the only way to do this. So we need insurance this API is official.
The text was updated successfully, but these errors were encountered: