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
Currently the world is a plain object that we just create a fresh one of for each test case attempt.
We should allow customising this from support code. In cucumber-js this was setWorldConstructor which assumed a class and didn't allow for async initialisation. We could do it a little differently here, like:
import{World}from'@cucumber/node'World(async()=>{// do async stuff herereturnmyWorld})
So the user provides an (optionally async) function that creates an object (could be a class, or something else) and returns it.
As part of this, we should also ensure that TypeScript users can easily set the type of their world in one place, like a declaration extension, and have that automatically honoured in all their step and hook functions without explicitly converting the type.
The text was updated successfully, but these errors were encountered:
Currently the world is a plain object that we just create a fresh one of for each test case attempt.
We should allow customising this from support code. In
cucumber-js
this wassetWorldConstructor
which assumed a class and didn't allow for async initialisation. We could do it a little differently here, like:So the user provides an (optionally async) function that creates an object (could be a class, or something else) and returns it.
As part of this, we should also ensure that TypeScript users can easily set the type of their world in one place, like a declaration extension, and have that automatically honoured in all their step and hook functions without explicitly converting the type.
The text was updated successfully, but these errors were encountered: