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

Running tests with gum #491

Open
dzonekl opened this issue Feb 2, 2024 · 1 comment
Open

Running tests with gum #491

dzonekl opened this issue Feb 2, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@dzonekl
Copy link

dzonekl commented Feb 2, 2024

Hi, I am embedding gum into a new modular zsh framework, which also runs tests on zsh functions.
These functions use gum choose and gum confirm for example and I would like to be able to automatically
confirm or choose an item from the list. Is there a way to do that ?

For example using yes command

# Should this work ? 
yes | gum confirm 

For a choice in a list

colors=(blue yellow) 
echo 'blue' | gum choose $colors
@hxlnt
Copy link

hxlnt commented Oct 19, 2024

+1.

gum confirm and gum choose do offer a timeout flag which is helpful for running automated tests. That will essentially just pick the default selection after a certain time has passed, so you'd have to write your tests accordingly.

However, there are some formats that don't have a timeout flag like gum table. Not sure how to get these to pass automated tests. Piping in yes "" doesn't work, but it would be great if it did!

@caarlos0 caarlos0 added the enhancement New feature or request label Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants