-
-
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
rework handling and docs for invalid installations #2089
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.
It looks pretty good!
Regarding the installation document, in the "duplicate" paragraph, it is emphased the use of external support code. I would also emphasize the use of third parties. And I would also mention the use of an old cucumber alongside the new @cucumber/cucumber one
Great points @aurelien-reeves - I've pushed some changes to address those. |
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.
Looks great :)
🤔 What's changed?
This PR improves the way we deal with invalid installations - that is, where the Cucumber instance that gets run isn't the one imported by the support code (see the new
installation.md
doc for a more expansive intro).For global installations, we had a check early in the CLI that would throw if it looked like a global installation (one of the ways you can be invalid). However this is prone to some false positives depending on users' platform tooling etc. The logic has been replaced by the is-installed-globally library which takes a different approach that should avoid those false positives. Also, it warns rather than throws, which is a hedge in case it has issues, but I could be talked out of that.
Before, with an invalid installation (e.g. with a duplicate dependency, or linking), you'd hit a rather cryptic error (
The "from" argument must be of type string. Received type undefined
), from which astute/lucky users could Google their way to our FAQ doc. We now intentionally detect the condition for that error (i.e. the support code library builder hasn't been initialised because it's not the instance of Cucumber that's actually running) and throw a descriptive message that links to a more useful installation doc. This will happen for global installs now too (as well as the warning).For testing, the existing feature test remains but is tweaked. The setup of the invalid installation moves from being a tagged hook to a "Given" step - just felt right from a Gherkin perspective.
⚡️ What's your motivation?
Fixes #1883.
🏷️ What kind of change is this?
♻️ Anything particular you want feedback on?
Using a proxy to wrap all the support methods in the check. Seemed like the cleanest and most maintainable way.
📋 Checklist:
This text was originally generated from a template, then edited by hand. You can modify the template here.