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

feat: add timeout option to prompt (Close #37) #38

Merged
merged 7 commits into from Oct 7, 2020

Conversation

loopingz
Copy link
Contributor

@loopingz loopingz commented Oct 1, 2020

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.

@codecov
Copy link

codecov bot commented Oct 1, 2020

Codecov Report

Merging #38 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #38   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines           58        62    +4     
  Branches        11        12    +1     
=========================================
+ Hits            58        62    +4     
Impacted Files Coverage Δ
lib/getOptions.js 100.00% <ø> (ø)
lib/prompt.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 822a6ab...b20b48d. Read the comment docs.

@loopingz
Copy link
Contributor Author

loopingz commented Oct 2, 2020

I had to remove the prompt timeout count as it was badly clearing the input line

lib/prompt.js Show resolved Hide resolved
lib/prompt.js Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
lib/prompt.js Outdated Show resolved Hide resolved
@loopingz
Copy link
Contributor Author

loopingz commented Oct 7, 2020

@satazor anything else you would like before merging?

@satazor satazor merged commit 3b84dd5 into moxystudio:master Oct 7, 2020
@satazor
Copy link
Contributor

satazor commented Oct 7, 2020

That’s all! Thank you. I will release soon.

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

Successfully merging this pull request may close these issues.

None yet

2 participants