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
feat: add timeout option to prompt (Close #37) #38
Conversation
Codecov Report
@@ Coverage Diff @@
## master #38 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 5 5
Lines 58 62 +4
Branches 11 12 +1
=========================================
+ Hits 58 62 +4
Continue to review full report at Codecov.
|
I had to remove the prompt timeout count as it was badly clearing the input line |
@satazor anything else you would like before merging? |
That’s all! Thank you. I will release soon. |
I implemented the timeout function
I was not able to emulate Ctrl+C to catch line 27 of prompt.js, if you have an idea, I'll update the test.
The options.timeout is in seconds, and you can use a {timeout} variable in the prompt to display, the remaining seconds before timeout.
I had to add the --runInBand to avoid interference on process.stdin/out by several tests, as timeout tests take several seconds.