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(cli/unstable): add promptSelect() #6190

Merged
merged 18 commits into from
Nov 25, 2024

Conversation

timreichen
Copy link
Contributor

Ref: #4678

Changes
Adds promptSelect() cli function.

@github-actions github-actions bot added the cli label Nov 16, 2024
Copy link

codecov bot commented Nov 16, 2024

Codecov Report

Attention: Patch coverage is 92.15686% with 4 lines in your changes missing coverage. Please review.

Project coverage is 96.56%. Comparing base (93e0cd6) to head (ef0a93d).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
cli/unstable_prompt_select.ts 92.15% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6190   +/-   ##
=======================================
  Coverage   96.56%   96.56%           
=======================================
  Files         532      533    +1     
  Lines       40819    40870   +51     
  Branches     6111     6122   +11     
=======================================
+ Hits        39416    39467   +51     
- Misses       1360     1361    +1     
+ Partials       43       42    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@kt3k
Copy link
Member

kt3k commented Nov 18, 2024

@timreichen
Copy link
Contributor Author

I've added some tests but need help resolving the current errors. The tests ran successfully locally. I don't know, why they occur and how to fix them.

@kt3k
Copy link
Member

kt3k commented Nov 20, 2024

The tests ran successfully locally. I don't know, why they occur and how to fix them.

I think you also need to stub Deno.stdin.setRaw (with empty function) to avoid error. (The error in CI seems happening because the stdin is not terminal in CI)

const encoder = new TextEncoder();
const decoder = new TextDecoder();

function spyFn<T, K extends keyof T>(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why create original spy util here? What was wrong with spy in @std/testing/mock?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spy didn't work for that purpose, but @std/testing/mock's stub() did it 👍

@timreichen timreichen marked this pull request as ready for review November 20, 2024 19:09
@Kacaii
Copy link

Kacaii commented Nov 21, 2024

Im really excited for this one! Its exactly what I've been looking for! <3

@kt3k kt3k changed the title feat(cli): add promptSelect() feat(cli/unstable): add promptSelect() Nov 25, 2024
Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests seem nicely written. LGTM

@kt3k kt3k merged commit 6795e7e into denoland:main Nov 25, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants