Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global variables not persisted through cucumberjs task #105

Open
dmruczek opened this issue May 10, 2017 · 1 comment
Open

Global variables not persisted through cucumberjs task #105

dmruczek opened this issue May 10, 2017 · 1 comment

Comments

@dmruczek
Copy link

dmruczek commented May 10, 2017

It seems that somewhere along the line of executing the cucumberjs task, global variables are lost. This is problematic when trying to use grunt-cucumberjs with something like grunt-istanbul which uses a global __coverage__ variable to store coverage information.

@dmruczek
Copy link
Author

After some further investigation, it looks like this problem can be solved by setting the "debugger" option within the cucumberjs task to "true". When you do this, cucumberjs uses "requireHandler" to run your scenarios within the current Node process. Without this setting, cucumberjs uses "processHandler", which spawns a new separate Node process to run your scenarios (which is why the global variable set during the execution of the scenarios is not persisted).

It might be helpful to add some information about this to the documentation, as it looks like the "debugger" option may be useful for more than just debugging within the IDE!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant