-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Version 1.3.1 breaks on babel-node
polyfied environment
#652
Comments
1.3.0 added es6 export default function module support. Every support file is required and if it exports a function, then it calls it. The problem is as what you ran into when you classes since they are technically functions. This has been something I've disliked about cucumber-js. One workaround for this (which should probably just be the suggested project setup) is to put any helper classes in a different folder and use |
Thanks for your answer. As I understand the solution for small project, it seems to be really complicated to do in a big project:I will have to many required file to manage to have all my features working. I'm not sure about the right solution for people who a doing ES2015 (or more recent): an option to disable this feature and let the user to use |
Can you explain more the possible solutions you are thinking about? I don't see this issue as being babel specific.I think it would be good to change how cucumber loads step definitions and other things to not just run any exported function but I'm uncertain at the moment how to do that. I'll create a new issue to track this. |
In a more thought, if you are familiar with PHP, the Behat project have strong proposal on how to deal with step definition and world (they call it context, and are multiple). Their proposal lead to more structure and forbid a lot of usage (generally wrong usage). It also imply that the library (here Instead of automatically load file, you could look on being more configurable. It could help to avoid auto-loading. |
Discussion moved to #679 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I'm trying to upgrade cucumber from
v1.2.2
tov1.3.1
. But the new version seems to not be compatible my installation.I'm using cucumberjs with ES2015 step files. For now, I'm using
babel-node
to polyfill the environment:After upgrading to the
v1.3.1
version, I've an error throw at startup:The
Car.js
file is directly imported in one of my step fileimport Car from './../fixtures/EventSourcing/Car';
and looks like this: https://gist.github.com/Spy-Seth/2fed28afa3e96e8ee7a1946a1c1e43b3 (a simple exported ES2015 class).I do not find a way to make this configuration working with the new version of cucumbejs. Do I do wrong something?
The text was updated successfully, but these errors were encountered: