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

blueprints/initializer-test: Add RFC232 variants #15946

Merged
merged 2 commits into from
Dec 10, 2017

Conversation

snewcomer
Copy link
Contributor

Progress on #15933

@snewcomer snewcomer force-pushed the initializer-rfc232-again branch 2 times, most recently from b4c7d55 to 90665a4 Compare December 8, 2017 16:55
Copy link
Member

@rwjblue rwjblue left a comment

Choose a reason for hiding this comment

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

Thanks for working on this! I'm sorry for the run around, but I think we are narrowing in on a really nice future for these types of tests.

setupTest(hooks);

hooks.beforeEach(function() {
run(() => {
Copy link
Member

Choose a reason for hiding this comment

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

Similar to the conversation in the instance-initializer PR, lets tweak this to avoid the manual run loop usage and leverage only public APIs.

I believe the result here would be something like:

module('Unit | Initializer | other stuff', function(hooks) {
  hooks.beforeEach(function() {
    this.TestApplication = Application.extend();
    this.TestApplication.initializer({
      name: 'other stuff',
      initialize
    });

    this.application = this.TestApplication.create({ autoboot: false });
  });

  hooks.afterEach(function() {
    destroyApp(this.application);
  });

  // Replace this with your real tests.
  test('it works', async function(assert) {
    await this.application.boot();

    assert.equal(self.bar, true);
  });
});

See https://github.com/rwjblue/__emberjs-PR15945_demo/blob/master/tests/unit/initializers/other-stuff-test.js for a demo app...

@rwjblue rwjblue merged commit c72e36e into emberjs:master Dec 10, 2017
@rwjblue
Copy link
Member

rwjblue commented Dec 10, 2017

Sorry for the run around on this. Thank you for working through it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants