-
Notifications
You must be signed in to change notification settings - Fork 260
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
Add test info mod rs #827
Add test info mod rs #827
Conversation
Trying a new approach in 3e2757d Thinking about how to handle git version (like excluding it) and removing colors. |
These assertion diffs are pretty hard to read 😆 |
Thank you @spenserblack , here is a pretty assertion: |
@spenserblack and @o2sh What are thoughts on using regular expressions in the expected output? Would this be better if a phrases were used: MATCH_UNTIL_END_OF_LINE or MATCH_WORD ? |
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.
Those diffs look much better now, thank you!
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.
Testing against a regex, and stripping out the ANSI escape sequences, looks much better IMO! 👍
Almost there! Just a few more comments.
Co-authored-by: Spenser Black <spenserblack01@gmail.com>
Co-authored-by: Spenser Black <spenserblack01@gmail.com>
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.
Now I want to write a macro to better support snapshot testing 😆
Here I was about to make a snapshot testing library, and in my research found that one exists 😆 It might be worth using this library for the JSON output test. |
Have a look at 6486d50 Ugh, then have a look at 75b427c for the insta snapshot file. The .gitignore file has *.snap in it to ignore snapshots. Insta setup went like this:
|
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.
Great work!
The .gitignore file has *.snap in it to ignore snapshots.
We might want to adjust the .gitignore
so that it ignores only the files it should ignore.
@o2sh Do you remember why *.snap
is in the .gitignore
?
If I remember correctly, this line was added for when I used to build the snapcraft package locally before publishing it to the Snap store - which is now done automatically via a Github link. I think this line can be safely removed. |
Change 69c6229 caused a snapshot change, testing gitignore change ;-) Also, gave another chance to use |
Yeah, snapshot testing is pretty interesting. It leans a bit towards "acceptance". That is, instead of a human writing a test for the machine to run and the code to pass, a human reviews the output and tells the machine if they like it. |
Rebased PR #822
Didn't realize that would close the other PR, sorry.