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

Projects
None yet
2 participants
@simonihmig
Copy link
Contributor

simonihmig commented Feb 21, 2018

As discussed in #190 (comment)

@Turbo87
Copy link
Member

Turbo87 left a comment

nice work 👏

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

This comment has been minimized.

@Turbo87

Turbo87 Feb 21, 2018

Member

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;

This comment has been minimized.

@Turbo87

Turbo87 Feb 21, 2018

Member
  • 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 added the enhancement label Feb 21, 2018

@simonihmig simonihmig force-pushed the simonihmig:hooks-workaround branch from ca5178c to af3e754 Feb 21, 2018

@simonihmig simonihmig force-pushed the simonihmig:hooks-workaround branch from af3e754 to 5f48e0f Feb 21, 2018

@Turbo87 Turbo87 merged commit 2a7a378 into emberjs:master Feb 21, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@simonihmig simonihmig deleted the simonihmig:hooks-workaround branch Feb 21, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment