Skip to content

Commit

Permalink
Merge pull request #17732 from simonihmig/fix-initializer-blueprint
Browse files Browse the repository at this point in the history
Fix initializer blueprint for ember-mocha 0.14
  • Loading branch information
rwjblue authored Mar 14, 2019
2 parents 1cd2e8e + 1aa9239 commit 099aaa5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';
import { describe, it, beforeEach, afterEach } from 'mocha';
import { setupTest } from 'ember-mocha';
import Application from '@ember/application';
import { initialize } from '<%= modulePrefix %>/initializers/<%= dasherizedModuleName %>';
<% if (destroyAppExists) { %>import destroyApp from '../../helpers/destroy-app';<% } else { %>import { run } from '@ember/runloop';<% } %>

describe('<%= friendlyTestName %>', function() {
hooks.beforeEach(function() {
beforeEach(function() {
this.TestApplication = Application.extend();
this.TestApplication.initializer({
name: 'initializer under test',
Expand All @@ -16,7 +16,7 @@ describe('<%= friendlyTestName %>', function() {
this.application = this.TestApplication.create({ autoboot: false });
});

hooks.afterEach(function() {
afterEach(function() {
<% if (destroyAppExists) { %>destroyApp(this.application);<% } else { %>run(this.application, 'destroy');<% } %>
});

Expand Down
6 changes: 3 additions & 3 deletions node-tests/fixtures/initializer-test/mocha-rfc232.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';
import { describe, it, beforeEach, afterEach } from 'mocha';
import { setupTest } from 'ember-mocha';
import Application from '@ember/application';
import { initialize } from 'my-app/initializers/foo';
import { run } from '@ember/runloop';

describe('Unit | Initializer | foo', function() {
hooks.beforeEach(function() {
beforeEach(function() {
this.TestApplication = Application.extend();
this.TestApplication.initializer({
name: 'initializer under test',
Expand All @@ -16,7 +16,7 @@ describe('Unit | Initializer | foo', function() {
this.application = this.TestApplication.create({ autoboot: false });
});

hooks.afterEach(function() {
afterEach(function() {
run(this.application, 'destroy');
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';
import { describe, it, beforeEach, afterEach } from 'mocha';
import { setupTest } from 'ember-mocha';
import Application from '@ember/application';
import { initialize } from 'my-app/init/initializers/foo';
import { run } from '@ember/runloop';

describe('Unit | Initializer | foo', function() {
hooks.beforeEach(function() {
beforeEach(function() {
this.TestApplication = Application.extend();
this.TestApplication.initializer({
name: 'initializer under test',
Expand All @@ -16,7 +16,7 @@ describe('Unit | Initializer | foo', function() {
this.application = this.TestApplication.create({ autoboot: false });
});

hooks.afterEach(function() {
afterEach(function() {
run(this.application, 'destroy');
});

Expand Down

0 comments on commit 099aaa5

Please sign in to comment.