gherkin-jest icon indicating copy to clipboard operation
gherkin-jest copied to clipboard

Add --tags filter?

Open rdickert opened this issue 7 years ago • 5 comments

I'd like to have functionality where I can choose which tests to run by tag/annotation like the --tags option in cucumber-js. So if I had some tests with @mobile and others without, I could choose to run only those, skipping other tests. It doesn't look like it'd be super hard. Would you take a PR adding that functionality? If so, do you have an opinion about how it should be implemented? I'm assuming it should go in stucumber near the code that handles skip.

rdickert avatar Dec 18 '17 23:12 rdickert

Interesting idea, thanks. I'm just about to change the way annotations are handled, so it's probably best to wait until that's settled. Hoping to get the API to a stage I can put a 1.0 version on it soon and avoid majorly breaking changes after that.

sjmeverett avatar Dec 20 '17 14:12 sjmeverett

Sounds good. I have a workaround for now. Let me know if I can be of any help

rdickert avatar Dec 20 '17 15:12 rdickert

Hi @rdickert - how do you propose this works? Anything you want me to do for it?

sjmeverett avatar Jan 10 '18 10:01 sjmeverett

@stewartml I want to be able to pass tags/annotations to run only those tests with those tags. I guess we could do it with env vars? Like TAGS=@foo,@bar jest test/features. Then it would run @foo and @bar but skip @baz or untagged tests. Does that sound like a good approach?

rdickert avatar Jan 16 '18 18:01 rdickert

Also I've filed a couple of other issues on this and stucumber. Let me know if you need help with anything - looks like these libs are still missing a couple of tests, and I might have some time Friday.

rdickert avatar Jan 17 '18 00:01 rdickert