-
-
Notifications
You must be signed in to change notification settings - Fork 85
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: support .each suite execution by regex #214
Conversation
Fixes #7. |
Additionally, Incomplete edge cases still remain. Similar describe/test cases will be matched by the same transformed regular expression. Like:
(2) is also executed by executing (1) and got no result, showing error, because (1) goes to |
Thank you for your contribution! Can you resolve conflicts, when you have the time, please? 🙏🏻 |
Ready for review. |
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.
LGTM! I love this. Initially I was skeptical of the use of regex, but after seeing the implementation, it should be stable.
@keroxp, @sheremet-va wants to know if we can merge this? |
@ffMathy I'm OK |
This introduces a bug. When there are more describes with the same name, you can't run the tests in the last describe. Example repro: import { describe, expect, it } from 'vitest'
import { add } from '../src/add'
describe('duplicate describe', () => {
it('test 1', () => {
expect(add(1, 1)).toBe(2)
})
})
describe('duplicate describe', () => {
it('test 2', () => {
expect(add(1, 1)).toBe(2)
})
}) With the above, "test 2" can't be run and will give an error. This worked before. |
cc @keroxp. Got an idea for a fix? I tried, but can't understand the code. |
Support an execution of
.each
describe/test suite that includes%
placeholders. vitest--testNamePattern
opts doesn't recognize pattern with%
placeholders. So we need to transform the given suite name by replacing%
to.+
regexp.The base branch of this PR is #213.