Skip to content
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

How to unit test and e2e test? #1060

Closed
williamhstone opened this issue Dec 6, 2024 · 2 comments
Closed

How to unit test and e2e test? #1060

williamhstone opened this issue Dec 6, 2024 · 2 comments

Comments

@williamhstone
Copy link

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
Copy link
Owner

rivo commented Mar 29, 2025

Adding unit tests to tview has been on my todo list for almost as long as the project exists. The idea is to create a special tcell.Screen object 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
Copy link
Author

williamhstone commented Mar 30, 2025 via email

@rivo rivo closed this as completed Mar 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants