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

fix: enforce default for non-confirmation prompts #415

Merged
merged 1 commit into from
May 11, 2020

Conversation

codebytere
Copy link
Member

@codebytere codebytere commented May 9, 2020

Fixes an edge case whereby if the user prompted for a number or input type and did not provide a default answer, prompt() would return true and like created a weird state.

This fixes that by enforcing that if non-confirmation prompts are invoked, a default is enforced. Also added tests to confirm correct behavior.

cc @targos @joyeecheung

@codebytere codebytere assigned targos and unassigned targos May 9, 2020
@codebytere codebytere requested a review from targos May 9, 2020 18:56
@codecov
Copy link

codecov bot commented May 9, 2020

Codecov Report

Merging #415 into master will increase coverage by 0.07%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #415      +/-   ##
==========================================
+ Coverage   76.28%   76.36%   +0.07%     
==========================================
  Files          21       21              
  Lines        1480     1485       +5     
==========================================
+ Hits         1129     1134       +5     
  Misses        351      351              
Impacted Files Coverage Δ
lib/cli.js 90.00% <100.00%> (+0.76%) ⬆️

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 157b508...a473834. Read the comment docs.

test/unit/cli.test.js Outdated Show resolved Hide resolved
test/unit/cli.test.js Outdated Show resolved Hide resolved
@codebytere codebytere merged commit 3e0f03d into nodejs:master May 11, 2020
@codebytere codebytere deleted the default-answer-prompt branch May 11, 2020 04:19
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.

2 participants