-
-
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
update config to support default definition function #2384
update config to support default definition function #2384
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for raising @notaphplover, this is looking good.
A few initial thoughts from me, if that's okay:
- It's neat that we allow static profile definitions to be done on other exports when doing the function, but that feels like a bit of a confusing API to me - I think it might be better to keep it simple, so you either a) provide static profiles with exports, or b) a single default export function to do it dynamically, and not a mixture of the two. What do you think?
- I also think we should avoid adding the
default: {}
in the new code - if the dynamically resolved config has no default key, I still think we want to have that logging happen below
Other than that, I think the next steps here would be:
- Add a
logger.debug
statement when we detect and run a function for config - Add a new e2e scenario at the end of https://github.com/cucumber/cucumber-js/blob/main/features/profiles.feature
- Add documentation in https://github.com/cucumber/cucumber-js/blob/main/docs/configuration.md and/or https://github.com/cucumber/cucumber-js/blob/main/docs/profiles.md
Let me know if you need a steer on anything!
You're very welcome, it's my pleasure 😃.
I totally agree with you.
I see, but then in some cases there will be no default profile. You know way better than me the code flows so I assume that's ok. Sure, I'll add the logging sentence.
Sure, I'll go for it.
Thank you so much! Sure, I'll do it. I'll try to have some time to continue on this on the weekend. |
Ah you're right, looking at the code again I see that the |
…eat/add-default-config-function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks very much @notaphplover!
🤔 What's changed?
This PR aims to allow
default
profile to be a function that dynamically generates cucumber profiles⚡️ What's your motivation?
Closes #2009.
🏷️ What kind of change is this?
♻️ Anything particular you want feedback on?
📋 Checklist:
This text was originally generated from a template, then edited by hand. You can modify the template here.