-
-
Notifications
You must be signed in to change notification settings - Fork 572
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 snapshot test using insta #2411
base: master
Are you sure you want to change the base?
Conversation
@extrawurst I just marked this PR as ready for review! I found it way easier to create the test than I had anticipated, mostly because the application is already structured in a way that is very amenable to snapshot testing. Known issues:
|
@extrawurst Did you get a chance to have a look? 😄 |
@cruessler ok i think this is a great prototype but i don't think its ready to be merged in this form.
|
@extrawurst I’ve extracted app initialization as well as the main loop into a new struct, I’m not sure about how to best implement a busy loop, though. We might be able to send the event that we get here, through a channel to the caller. Then, we could, in the caller, have a |
@cruessler awesome!
yeah lets do that. |
This will hopefully make the test green on CI.
This will hopefully make the test green on CI.
@extrawurst This PR is another try at adding snapshot tests to
gitui
. It doesn’t render to SVG as some of the other approaches do, but it works with the existingApp
anddraw
and only requires a minor type change in order to get it to work. Also, the text-based snapshot is still reasonably easy to read. So this feels very promising.Next, I want to try to write a test that has interactivity, be it loading data from an actual git repo or keyboard input from a user.