mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 13:25:51 +03:00
[GH-ISSUE #1060] How to unit test and e2e test? #766
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#766
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @williamhstone on GitHub (Dec 6, 2024).
Original GitHub issue: https://github.com/rivo/tview/issues/1060
How can I unit test my code? Is there some mocking that can be done with tview.NewApplication and tview.NewPages?
Also, how can I end-to-end test? I want to bring up my app, update some form fields and validate the updates on screen?
Thanks!
@rivo commented on GitHub (Mar 29, 2025):
Adding unit tests to
tviewhas been on my todo list for almost as long as the project exists. The idea is to create a specialtcell.Screenobject whose content is then extracted and compared after the test has run.You might want to create something like that for you application. I haven't given it much thought, though, so I don't know the pitfalls of this technique yet.
@williamhstone commented on GitHub (Mar 30, 2025):
Thanks for the response!
On Sat, Mar 29, 2025 at 8:25 AM rivo @.***> wrote: