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

Run a subset of tests #98

Closed
lloydwatkin opened this issue May 15, 2014 · 5 comments
Closed

Run a subset of tests #98

lloydwatkin opened this issue May 15, 2014 · 5 comments

Comments

@lloydwatkin
Copy link
Contributor

Is there a way to run a subset of tests (I'm integrating yadda with mocha).

Currently I'm fudging it by adding an only annotation and calling done for tests which don't have this annotation (if there is an @Only anywhere in my test suite.

This is ok except:

  • It shows all other tests as passed (not so much of an issue)
  • It still runs before, after, beforeEach, afterEach which is causing the browser to still open and close (which slows things down), there is no this for the context of these functions. Maybe we could pass the scenario to it?
@cressie176
Copy link
Member

mocha -g "some text" will run tests which match the specified string. Be careful though - if you are using the StepLevelPlugin instead of the ScenarioLevelPlugin, it will only run the steps which match the text, not the whole scenario.

I'll look into supporting @only. Suspect it will also work incorrectly with the StepLevelPlugin

@lloydwatkin
Copy link
Contributor Author

Great, thanks! Would be very helpful.

@cressie176
Copy link
Member

As of 0.10.12 you should be able to annotate a feature or scenario with @only to get mocha's describe.only and it.only functionality

@lloydwatkin
Copy link
Contributor Author

👍

@lloydwatkin
Copy link
Contributor Author

Confirmed on both 'feature' and 'scenario'. Thanks!

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