-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Revise before and after options that were added in v1.4.0 #8
Comments
Completed this with https://github.com/bevry/joe/blob/9115d8608f1ee6707b96ffba74d57c8ca5db340b/src/example/example1.coffee#L66-L100 @pflannery @christav is this good by you? |
Seems good to me. One question: how does it interact with nested suites? My default expectation if I have an outer suite and an inner suite with tests in each, that the behavior would be: For test in outer suite: For tests in inner suite: Also, any chance of getting "suite.before" and "suite.after" events as well? |
Yeah suite after and suite before are there too, not tests yet for them. Currently for inner items, they do not inherit their parent/outer events. How essential is that? |
I think the nested ordering is important.
To expand on #3, when writing Given/When/Then style tests (I tend not to go to cucumber unless there's going to be a big investment, but I find it really useful as a way to organize my thoughts/tests), I'll often set up my tests something like (mocha like example):
Hope that makes sense. I find it a really useful style, and without predictable and nested ordering for before/after functions I can't do it. |
does beforeEach in the above example also run before each suite, or only before each test |
Sorry, using Mocha terminology. beforeEach is the equivalent of your "test.before" event. "before" is the "suite.before" event. So no, beforeEach does not run before each suite, only before each test. However, the "suite.before" events should act in a similar manner - outer's suite.before should fire, then run outer's tests, then inner.before should fire, then inner's tests should run, etc. |
I'll probably introduce a new event for nesting something like |
Done with the |
Does mocha's beforeEach and afterEach functions support completion callbacks? If not, this makes what joe does even more awesome, as we do. |
A few commits ago, I also re-added support for the |
Yes, mocha provides completion callbacks for before, beforeEach, after, and afterEach. Sorry. :-) |
Joe v1.5 and TaskGroup v4 released which now accomplish this :) |
I forgot to ask why adding them was a good idea, as knowing why, we can be able to come up with better solutions, without knowing why, we just know what, and we can't change what.
#5 (comment)
The text was updated successfully, but these errors were encountered: