-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Core: Improve project root detection logic #20791
Core: Improve project root detection logic #20791
Conversation
- Support `.hg` - Support `.yarn` - Support an env var STORYBOOK_PROJECT_ROOT as an override if other detection methods are not working
Hey, @dobesv! Thank you for this contribution (and congratulations on your first!). Could you add some tests for this, please? |
Any pointers on how and where to add the tests? I'm not too familiar with the project, and I don't think there are existing tests for this function unfortunately. It seems a bit tricky to test. |
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.
I left 2 comments
@dobesv thank you for contributiong! I think this change is good, but I'd like it implemented in a slightly different way, I hope you can make that happen? 🙏 |
Thanks for the review @ndelangen . I made changes based on your feedback. If you have any thoughts about how I could make automated tests for this without a ton of work, let me know. |
We could add tests that mock |
.hg
.yarn
Issues: #20314 #14042 #20211
What I did
Update getProjectRoot logic to cover additional use cases.
How to test
See the related issues for the cases that lead to this.
Checklist
MIGRATION.MD
Maintainers
make sure to add the
ci:merged
orci:daily
GH label to it.