Skip to content

Commit

Permalink
fixup based on comments
Browse files Browse the repository at this point in the history
  • Loading branch information
snewcomer committed Dec 10, 2017
1 parent 8156867 commit 4879d49
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Application from '@ember/application';
import { run } from '@ember/runloop';

import { initialize } from '<%= dasherizedModulePrefix %>/initializers/<%= dasherizedModuleName %>';
import { initialize } from '<%= dasherizedModulePrefix %>/instance-initializers/<%= dasherizedModuleName %>';
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
import destroyApp from '../../helpers/destroy-app';
Expand All @@ -10,20 +9,23 @@ module('<%= friendlyTestName %>', function(hooks) {
setupTest(hooks);

hooks.beforeEach(function() {
run(() => {
this.application = Application.create();
this.application.deferReadiness();
this.TestApplication = Application.extend();
this.TestApplication.instanceInitializer({
name: 'initializer under test',
initialize
});
this.application = this.TestApplication.create({ autoboot: false });
this.instance = this.application.buildInstance();
});
hooks.afterEach(function() {
destroyApp(this.application);
destroyApp(this.instance);
});

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

// you would normally confirm the results of the initializer here
assert.ok(true);
});
});
18 changes: 10 additions & 8 deletions node-tests/fixtures/instance-initializer-test/rfc232.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Application from '@ember/application';
import { run } from '@ember/runloop';

import { initialize } from 'my-app/initializers/foo';
import { initialize } from 'my-app/instance-initializers/foo';
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
import destroyApp from '../../helpers/destroy-app';
Expand All @@ -10,20 +9,23 @@ module('Unit | Instance Initializer | foo', function(hooks) {
setupTest(hooks);

hooks.beforeEach(function() {
run(() => {
this.application = Application.create();
this.application.deferReadiness();
this.TestApplication = Application.extend();
this.TestApplication.instanceInitializer({
name: 'initializer under test',
initialize
});
this.application = this.TestApplication.create({ autoboot: false });
this.instance = this.application.buildInstance();
});
hooks.afterEach(function() {
destroyApp(this.application);
destroyApp(this.instance);
});

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

// you would normally confirm the results of the initializer here
assert.ok(true);
});
});

0 comments on commit 4879d49

Please sign in to comment.