Skip to content

Conversation

@bkendall
Copy link
Contributor

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 Bug or defect 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
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
@bkendall bkendall deleted the fix-aftereach-order branch May 19, 2015 21:08
@lock
Copy link

lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Bug or defect

Projects

None yet

Development

Successfully merging this pull request may close these issues.

afterEach's run in unnatural order

2 participants