amiceli / vitest-cucumber

Use gherkin in your unit tests with vitest
https://vitest-cucumber.miceli.click
41 stars 5 forks source link

feat: improve tag filtering #146

Closed Odonno closed 1 month ago

Odonno commented 1 month ago
amiceli commented 1 month ago

I'm OK for includeTags for global config and feature and to set tags to Set<string>. I will keep @ for tags but as optional like @ignore or ignore. It's to prevent a breaking change, what do you thing ?

But I don't see nested tags (AND, OR) useful. I saw it on jest-cucumber for example, but I see that useless.

Odonno commented 1 month ago

Well, I don't see why you are talking about breaking change. From reading the code, I saw you automatically remove the @ prefix before using it. It's ok to me. My change is, for example, to replace @ignore by ignore as people are usually thinking of tags with the @. So, it's more of being developer friendly and handling all cases, whether they use the @ or not for excludeTag/includeTag.

Well, for the case of nested tag filtering. it is for when you have hundreds of tests with an extended use of tags. Some have multiple tags and you'd like to only run the tests that both have @a and @b for example. I know this is a niche feature but I believe this is something that can be expected. Overall, it does not bring much complexity and it is not as complex as the parsed string cucumber expression. I really like the includeTags and excludeTags, nesting is just a useful extension only when it's needed.

amiceli commented 1 month ago

Ok, you're right for both features. I'm reviewing code and I will test it on my projects before merge it.

amiceli commented 1 month ago

2000 tests passes, everything is OK ;). I merge, publish a version and I'm going to update doc about tags.