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: allow changing name pattern during watch mode #819

Merged
merged 4 commits into from Feb 21, 2022

Conversation

sheremet-va
Copy link
Member

Closes #658

@netlify
Copy link

netlify bot commented Feb 20, 2022

✔️ Deploy Preview for vitest-dev ready!

🔨 Explore the source changes: 5751c9e

🔍 Inspect the deploy log: https://app.netlify.com/sites/vitest-dev/deploys/62126b18e9c76c0008ea107a

😎 Browse the preview: https://deploy-preview-819--vitest-dev.netlify.app

@patak-dev
Copy link
Member

I tested locally and I can't type the pattern once I select the option. I can only press enter.
The PATTERN label isn't visible due to contrast, at least in my terminal (that I think has a proper font and color theme)
image

@patak-dev
Copy link
Member

About the wording, Jest uses "Press t to filter by a test name regex pattern.". Maybe we could also expand it to "Change test name pattern"? The testNamePattern casing looks a bit off in the middle of the other options.

@sheremet-va
Copy link
Member Author

I tested locally and I can't type the pattern once I select the option. I can only press enter. The PATTERN label isn't visible due to contrast, at least in my terminal (that I think has a proper font and color theme) image

Oh, I did too much refactoring 👀

@sheremet-va
Copy link
Member Author

Changed the color to magenta
Снимок экрана 2022-02-20 в 18 59 37

@patak-dev
Copy link
Member

Looks good now! And I can type. But if I press backspace it writes "backspace" and if I tried to use uppercase it doesn't let me. I was trying to write "JSON" to filter that one.

@sheremet-va
Copy link
Member Author

Looks good now! And I can type. But if I press backspace it writes "backspace" and if I tried to use uppercase it doesn't let me. I was trying to write "JSON" to filter that one.

Should be fixed 😃
First time using this API!

Copy link
Member

@patak-dev patak-dev left a comment

Choose a reason for hiding this comment

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

Works great!

One thing about DX, maybe we shouldn't show the skipped tests when using this option, because if there are a lot of them you don't see the ones that were filtered (for example with JSON in the core tests)

@sheremet-va
Copy link
Member Author

Works great!

One thing about DX, maybe we shouldn't show the skipped tests when using this option, because if there are a lot of them you don't see the ones that were filtered (for example with JSON in the core tests)

I agree, but this is more about testNamePattern implementation

@antfu antfu merged commit 0b2bc38 into main Feb 21, 2022
@antfu antfu deleted the sheremet-va/change-name-pattern branch February 21, 2022 05:57
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.

Add testNamePattern to help's CLI input
3 participants