Closed obouhlel closed 1 week ago
I expect the
support
variable to retain thestepDefinitions
attribute.
Your support
variable only exists in the scope of your run
function though, so each invocation tries to create it afresh, but you're in the same overall Node.js process so it only works the first time.
Assuming your support code is consistent across your runs, then you should be able to call loadSupport
just once upfront, before any of your calls to run
, and pass in your support
object each time.
π What did you see?
With this code:
The second time I run the scenario (or any subsequent runs), the steps are undefined. When I log the support variable using console.log, the stepDefinitions attribute is empty.
β What did you expect to see?
I expect the
support
variable to retain thestepDefinitions
attribute.π¦ Which tool/library version are you using?
node: 18.20.4 cucumber: 11.0.1
π¬ How could we reproduce it?
In this repository, I have created a simple test to reproduce this issue.
npm install
npm run test
π Any additional context?
No response