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 write unit testing for dialoguer ? #95

Open
sdttttt opened this issue Nov 10, 2020 · 4 comments
Open

How to write unit testing for dialoguer ? #95

sdttttt opened this issue Nov 10, 2020 · 4 comments
Labels
t-feature Type: Feature request

Comments

@sdttttt
Copy link

sdttttt commented Nov 10, 2020

Thank you for this great project :)

I wrote an interactive cli program. I want to do unit tests for some of these input actions to try to improve my test coverage.
But I have encountered difficulties, I tried to use io::stdout, but it didn't work.

How do I test the movements of dialoguer?

@pksunkara
Copy link
Collaborator

Unfortunately, I haven't looked into it, but I am open to PRs.

@sdttttt
Copy link
Author

sdttttt commented Nov 10, 2020

Unfortunately, I haven't looked into it, but I am open to PRs.

Thank for your precious time to answer my question!
I'll try to find another way.

@xenoterracide
Copy link

I was about to ask the same question... I was wondering if there was a stub implementation for the IO in Term, maybe it's possible to just stub Term?

@pksunkara pksunkara added the t-feature Type: Feature request label Nov 23, 2021
@danieleades
Copy link
Contributor

danieleades commented Dec 5, 2021

Might be worth merging #158 before embarking on this, in order to track the progress

That is, assuming whatever is used to unit test crates using dialoguer is also used to unit test dialoguer itself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t-feature Type: Feature request
Projects
None yet
Development

No branches or pull requests

4 participants