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
Lazily execute beforeAll/afterAll code blocks (with grep) #350
Comments
+1 i run into this issue a lot |
ah good call, I'll see if I can get this in the next release |
…ll/afterAll hooks not being called. mochajs#350
@visionmedia, I've got an initial implementation that's working for me, but I'm not sure if that's the approach you would have taken. I also need to provide tests. Let me know if you want me to flesh this out and do a pull request. BTW, I noticed a bug where if you specify multiple before/afterAll hooks, only one gets executed. My patch has that fixed (calling hookUp/Down instead of hook). |
…to make sure unneeded before/after hooks aren't being called. mochajs#350
…only contain pending tests. mochajs#350
This issue has been inactive for over 1 month so I'm closing it. If you think it's still an issue re-open. - tjbot |
When using grep, I would like only the
beforeAll
/afterAll
blocks needed by tests matching my grep to be executed.Currently all
beforeAll
andafterAll
callbacks get executed, regardless of whether any tests being run depend on them.If you have a large test suite that uses beforeAll blocks to consolidate expensive setup, using grep to isolate a test may not speed up the run all that much because of this.
In the following example, when running
mocha --grep Files
I would expect "expensive setup needed for Database suite" not to be executed.The text was updated successfully, but these errors were encountered: