Replies: 1 comment
-
|
These are great ideas! I would also like to add that Bubble Tea could use more integrated tests via Using VT would allow us to capture the terminal screen content at any given time, and send input events to applications to see how they react. Basically, simulate running applications on actual terminals using TTYs/Consoles. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Some ideas that could potentially improve teatest/golden (and testing bubbletea apps in general) after I initially started using the 2 packages (teatest/golden):
View(), so users can use TestModel for both golden and non-golden testing for alt-mode based apps. Right now it seems like 1 or the other.m.WaitForContains(tb, "foo", "bar", "baz")for testing that a program contains multiple outputs-updatetest flag is a bit annoying to work with. e.g., can't recursively use it across all tests, because any tests that don't have the-updateflag (e.g., regular go tests), it will cause those tests to fail because they don't define that flag. An alternative option should probably be supported. e.g., aUPDATE_GOLDEN=booltype env var, which will make things likeUPDATE_GOLDEN=true go test -v ./...more seamless.namefield, or an additional function where you can pass a name, to create multiple snapshots in a single test.colorprofile, so it can strip/simplify colors, so changing of colors doesn't fail tests, if the user doesn't care about colors. e.g., passing in the ascii colorprofile. I have local code for this I can PR as well.Right now, most users who use teatest that I've seen have a bunch of wrapper logic around it, so hoping to improve the experience a bit so it doesn't feel as annoying to test bubbletea UI logic
Also FWIW, https://github.com/gkampitakis/go-snaps does a lot of really cool stuff around snapshot-based tests that might be good inspiration. I would say we could wrap that library, but they have a bunch of dependencies, so probably wouldn't be worth it. Some of the things they do:
Beta Was this translation helpful? Give feedback.
All reactions