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

Change afterEaches to run in more natural order #359

Merged
merged 1 commit into from May 19, 2015

Conversation

@bkendall
Copy link
Contributor

bkendall commented May 15, 2015

This fixes #357. In order to have afterEaches run in a more natural order (closest to the test first and out through the experiments), this prepends the afterEaches to the returned set as it finds them. The blocks are then run in a more natural order. As a side note: this still is running them in the order they are defined in the experiments.

A test has been added in the suite for this change, but to specifically show the test displayed in the issue, the output with this branch is as follows:

$ lab test.js
outer: before
inner: before
outer: beforeEach
inner: beforeEach
test.
inner: afterEach # inner afterEach is now before outer
outer: afterEach
inner: after     # inner after is still before outer after
outer: after
@geek geek added the bug label May 19, 2015
@geek geek self-assigned this May 19, 2015
@geek geek added this to the 5.9.0 milestone May 19, 2015
@geek

This comment has been minimized.

Copy link
Member

geek commented May 19, 2015

Well done, very clean.

geek added a commit that referenced this pull request May 19, 2015
Change afterEaches to run in more natural order
@geek geek merged commit 02e48fa into hapijs:master May 19, 2015
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@bkendall bkendall deleted the bkendall:fix-aftereach-order branch May 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.