You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.
How can I provide input from byte array or text file for survey? I want to use it for test purposes.When I ask for input, I want to send mock value. Example code:
Hi, mocking Survey responses currently isn't straightforward and will only become easier after #428.
In the meantime, you can set up a virtual terminal in your tests to simulate user input to your prompt: https://github.com/AlecAivazis/survey#testing. Note that this also isn't straightforward.
My personal choice would be to declare a Prompter type in your code that has a method like PromptInput that uses Survey under the hood:
Then, in test mode, pass a mock object to your app that responds to PromptInput() but returns pre-defined fake responses. That way, Survey never gets actually invoked in tests, and you avoid a whole lot of trouble.
How can I provide input from byte array or text file for survey? I want to use it for test purposes.When I ask for input, I want to send mock value. Example code:
The text was updated successfully, but these errors were encountered: