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

Add documentation for filtering (grep, invert, tags, skipTags) #1475

Closed
wants to merge 2 commits into from
Closed

Add documentation for filtering (grep, invert, tags, skipTags) #1475

wants to merge 2 commits into from

Conversation

rprieto
Copy link
Contributor

@rprieto rprieto commented Dec 17, 2014

Documents the new --tags and --skip-tags options from pull request #1445.

@dasilvacontin
Copy link
Contributor

Btw, it there a way to only run tests tagged both with tag 'x' and tag 'y'?

@rprieto
Copy link
Contributor Author

rprieto commented Dec 18, 2014

That's something we talked about early on at #1445, with a special syntax like api+integration, but it raised a few questions (can you do (api AND integration) OR app, what about (api AND integration) not (slow OR redis)...).

I think @boneskull's comment was "make it as simple as possible", which I think is nice. So we ended up with --tags x,y,z to run tests with either tags, and --skip-tags x,y,z to skip tests with either tags.

It's true that it would be nice, since "run api integration tests" sounds like a common scenario. Another approach could have been x,y,z to mean AND, and repeat the --tags command to OR them together:

# run tests with (api AND integration) OR (app AND integration)
# exclude tests with (unit AND slow) OR (redis)
mocha --tags api,integration --tags app,integration --skip-tags unit,slow --skip-tags redis

I'm happy to revisit the PR if the Mocha team thinks it's useful. Good news is there's lots of tests so it should be an easy change 😃

@dasilvacontin
Copy link
Contributor

I continue discussing at #1445.

@rprieto
Copy link
Contributor Author

rprieto commented Dec 18, 2014

@dasilvacontin I added a new commit (docs only) to show the + operator. If that's what you had in mind I'll have a go at the implementation.

@dasilvacontin
Copy link
Contributor

LGTM, though it would be desirable to get a 👍 from either @boneskull or @travisjeffery since I'm not really a maintainer. 😅

@rprieto
Copy link
Contributor Author

rprieto commented Dec 18, 2014

Haha I didn't know that. Yep will hold off for now!

@dasilvacontin
Copy link
Contributor

Haha, no problemo. Just check for the Collaborator/Owner badge. :)

I hope you get an answer soon!

@boneskull
Copy link
Contributor

I'm pretty overloaded atm. Hopefully will have some time next week around xmas to look at stuff.

@dasilvacontin
Copy link
Contributor

don't worry @boneskull! holidays are coming :)

@rprieto
Copy link
Contributor Author

rprieto commented Jan 14, 2015

Happy new year! I'm keen to revive this PR, see what everyone thinks (either the simple --tags a,b,c version, or the slightly more complex but more powerful --tags a+b,c+d version)

@rprieto
Copy link
Contributor Author

rprieto commented Jul 6, 2015

Fair enough, we can probably revisit this if required. Does this mean any activity on #1445? :)

@jbnicolai
Copy link

Ah, no @rprieto - sorry for the confusion. GH closed this PR as it was directed at the now moved mochajs/mocha#gh-pages branch, which now resides under mochajs/mochajs.github.io#master.

I'll tag this for follow-up, and move it over to the new repo as soon as possible.

@jbnicolai jbnicolai added the area: documentation anything involving docs or mochajs.org label Jul 6, 2015
@jbnicolai
Copy link

And in response to your other question: #1445 is definitely still on my radar. We've been cutting our way through the long-lived PRs for a few days now, and we're down to 17 right now (from 35+ a few days back). So we'll get there :)

@rprieto
Copy link
Contributor Author

rprieto commented Jul 6, 2015

Haha right, no problem then :) Nice work on the PRs!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: documentation anything involving docs or mochajs.org
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants