-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix: add possibility to filter test files by fileName #1915
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
Conversation
failing on check: CI / test (windows-latest, 16), examples/playwright |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like basing solution on testNamePattern
. We can already define a pattern for tests with include
.
If you just want to add -p
option to CLI, you can call this.rerunFiles
with a new set of files, filtered by the new pattern.
Hello, I added a new folder According to your review, I have updated the |
No, what I meant is that we don't need this property at all, because we already have I don't mind using regex for this. |
@bartoszgolebiowski I pushed some changes to your PR. We don't have tests for stdin right now, unfortunately tho, and creating infrastructure for it is out of scope of this PR, I think. But would be great to have this stuff tested. I also noticed that after rerunning it doesn't update test count, can you look into that? |
Hello @sheremet-va I added one failing test in the This filter runs all tests inside To resolve it, we can still use 0fcdd52#diff-ff14f3092ee007d54e9c9f53fa4044149899b44fa12979cc92f1d182d1a2b057R45 and assigning this value to let latestFilename = String(ctx.config.fileNamePattern || '') BR |
Yes, but this doesn't actually test the interaction that user has - pressing "p" and inserting filter. |
@sheremet-va BR |
* feat(vite-node): add possibility to filter test files by fileName * feat(vite-node): change filtering mechanism to use 'includes' method * refactor: use globTestFiles to filter by filename Co-authored-by: golebiowskib <bartosz.golebiowski@@ttpsc.pl> Co-authored-by: Vladimir Sheremet <sleuths.slews0s@icloud.com>
The file name filter doesn't work at all. Using All tests files are still being executed. |
Hello,
fix #1797
I have created PR with a new option for "node-vite".
I added to vitest config new property "fileNamePattern", it is similar to "testNamePattern"
It is responsible for skipping test files when the pattern does not match.
I added documentation for "fileNamePattern" next to "testNamePattern" property.
I added additional information for the CLI help option about the new property.
I added a test case to check if the new functionality works as expected.
To test it you can: