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

Using label-filter to execute non labeled tests #1312

Open
ziccardi opened this issue Nov 30, 2023 · 2 comments
Open

Using label-filter to execute non labeled tests #1312

ziccardi opened this issue Nov 30, 2023 · 2 comments

Comments

@ziccardi
Copy link

Hello everyone!

Is there a way to specify a label-filter that executes all tests that has no label and all tests with a specific label?

I tried with // || mylabel but didn't work

Thank you in advance,
Massimiliano

@onsi
Copy link
Owner

onsi commented Nov 30, 2023

hey - good question. I haven't run into this before but you can make it work. label-filter accepts regular expressions. So you can target all specs with no labels via !/./ and then you can OR in the tests with a specific label via !/./ || LABEL

You might have to escape the ! on the terminal with \! but I just tried this locally and it worked. Give it a try!

@ziccardi
Copy link
Author

Looks like !/./ does the trick!

Thank you very much!

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

No branches or pull requests

2 participants