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

Add hooks API for setupContainerTest() to improve beforeEach/afterEach ordering #192

Merged
merged 1 commit into from
Feb 21, 2018

Conversation

simonihmig
Copy link
Contributor

As discussed in #190 (comment)

Copy link
Member

@Turbo87 Turbo87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work 👏

beforeEachHooks.push(fn);
},
afterEach(fn) {
afterEachHooks.push(fn);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we use unshift() instead so that we don't have to .reverse()?

function setupFoo(hooks) {
hooks.beforeEach(function() {
expect(this.owner, 'Context is set up already').to.exist;
this.count = 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • due to the context resetting stuff we do we should probably track this outside of this
  • I think it would be better to track the order with a step list instead of incrementing a counter

@Turbo87 Turbo87 merged commit 2a7a378 into emberjs:master Feb 21, 2018
@simonihmig simonihmig deleted the hooks-workaround branch February 21, 2018 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants