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
Fix help text indentation #4531
Conversation
Including TAB in some lines.
I would say having Can we just update |
@hudochenkov I understand what you say, but I'd like to test a broken indentation, not to test including TABs. Also, I have the following reasons to test the help text:
What do you think? I'm glad to accept if there is a better way! 😄 |
How about using the new Jest "inline snapsot" functionality instead?
|
@ntwb Thanks, looks good. But I'm unfamiliar with the functionality. If you can change soon, welcome to push your change to this PR! 🙌 |
I pushed e9ce817 using @hudochenkov How about this? |
Looks like we need ability to generate help text =) @ybiquitous Unfortunately this test does not make much sense, since it is just a copy paste. From my perspective we need move each option description in meow settings aka:
|
|
@vankop Thanks for your feedback. The snapshot value is automatically generated when we run the test, so I don't think it's just a copy-paste.
|
@hudochenkov I can accept also |
@ybiquitous regular snapshot are generated by Jest. If snapshot doesn't match, we can tell Jest to update it. Shapshots are not supposed to be changed manually. |
Make sense! 👍 I will fix to use |
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!
@hudochenkov Thanks, too. After all approval, I will squash to one commit before merge. |
No need for squashing, I'll do it on merge with a press of a single button :) |
I was also thinking along the lines of what @vankop wrote above in #4531 (comment) Instead of testing for the entire output, each cli option could have it's own test to ensure the output of each command would match the test, this could use either Anyways, not a blocker for this PR, happy to see it merged and this could be considered in a follow up PR. It maybe beneficial to do something like this to improve the cli tests before adding types. |
@ntwb Thanks for your reply. Sadly, meow does not have the auto-generation of help text: So, we have to write our own code or contribute to meow. There may be based implementation already: sindresorhus/meow#82
If we test each description instead of the whole help text, the inline snapshot may be better. 👍
I completely agree. 😃 |
Damn it behave so unobviously =( I thought that @ybiquitous copy paste help info 🤦♂️ Maybe better to keep snapshots as separated files |
Because of TAB included in some lines, help text indentation is broken. This fixes the bug.
Two commits included:
Please compare the diff between each commit.