Skip to content

Commit d020381

Browse files
committed
Remove runloop from test blueprints
1 parent 0919894 commit d020381

6 files changed

Lines changed: 11 additions & 15 deletions

File tree

blueprints/initializer-test/files/__root__/__testType__/__path__/__name__-test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import config from '<%= modulePrefix %>/config/environment';
44
import { initialize } from '<%= modulePrefix %>/initializers/<%= dasherizedModuleName %>';
55
import { module, test } from 'qunit';
66
import Resolver from 'ember-resolver';
7-
<% if (destroyAppExists) { %>import destroyApp from '../../helpers/destroy-app'; <% } else { %>import { run } from '@ember/runloop'; <% } %>
7+
<% if (destroyAppExists) { %>import destroyApp from '../../helpers/destroy-app'; <% } %>
88

99
module('<%= friendlyTestName %>', function (hooks) {
1010
hooks.beforeEach(function () {
@@ -25,7 +25,7 @@ import Resolver from 'ember-resolver';
2525
});
2626

2727
hooks.afterEach(function () {
28-
<% if (destroyAppExists) { %> destroyApp(this.application); <% } else { %> run(this.application, 'destroy'); <% } %>
28+
<% if (destroyAppExists) { %> destroyApp(this.application); <% } else { %> this.application.destroy(); <% } %>
2929
});
3030

3131
// TODO: Replace this with your real tests.

blueprints/instance-initializer-test/files/__root__/__testType__/__path__/__name__-test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import config from '<%= modulePrefix %>/config/environment';
44
import { initialize } from '<%= modulePrefix %>/instance-initializers/<%= dasherizedModuleName %>';
55
import { module, test } from 'qunit';
66
import Resolver from 'ember-resolver';
7-
<% if (destroyAppExists) { %>import destroyApp from '../../helpers/destroy-app';<% } else { %>import { run } from '@ember/runloop';<% } %>
7+
<% if (destroyAppExists) { %>import destroyApp from '../../helpers/destroy-app';<% } %>
88

99
module('<%= friendlyTestName %>', function (hooks) {
1010
hooks.beforeEach(function () {
@@ -26,8 +26,8 @@ module('<%= friendlyTestName %>', function (hooks) {
2626
this.instance = this.application.buildInstance();
2727
});
2828
hooks.afterEach(function () {
29-
<% if (destroyAppExists) { %>destroyApp(this.instance);<% } else { %>run(this.instance, 'destroy');<% } %>
30-
<% if (destroyAppExists) { %>destroyApp(this.application);<% } else { %>run(this.application, 'destroy');<% } %>
29+
<% if (destroyAppExists) { %>destroyApp(this.instance);<% } else { %>this.instance.destroy();<% } %>
30+
<% if (destroyAppExists) { %>destroyApp(this.application);<% } else { %>this.application.destroy();<% } %>
3131
});
3232

3333
// TODO: Replace this with your real tests.

node-tests/fixtures/initializer-test/addon.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import config from 'dummy/config/environment';
44
import { initialize } from 'dummy/initializers/foo';
55
import { module, test } from 'qunit';
66
import Resolver from 'ember-resolver';
7-
import { run } from '@ember/runloop';
87

98
module('Unit | Initializer | foo', function (hooks) {
109
hooks.beforeEach(function () {
@@ -25,7 +24,7 @@ module('Unit | Initializer | foo', function (hooks) {
2524
});
2625

2726
hooks.afterEach(function () {
28-
run(this.application, 'destroy');
27+
this.application.destroy();
2928
});
3029

3130
// TODO: Replace this with your real tests.

node-tests/fixtures/initializer-test/app.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import config from 'my-app/config/environment';
44
import { initialize } from 'my-app/initializers/foo';
55
import { module, test } from 'qunit';
66
import Resolver from 'ember-resolver';
7-
import { run } from '@ember/runloop';
87

98
module('Unit | Initializer | foo', function (hooks) {
109
hooks.beforeEach(function () {
@@ -25,7 +24,7 @@ module('Unit | Initializer | foo', function (hooks) {
2524
});
2625

2726
hooks.afterEach(function () {
28-
run(this.application, 'destroy');
27+
this.application.destroy();
2928
});
3029

3130
// TODO: Replace this with your real tests.

node-tests/fixtures/instance-initializer-test/addon.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import config from 'dummy/config/environment';
44
import { initialize } from 'dummy/instance-initializers/foo';
55
import { module, test } from 'qunit';
66
import Resolver from 'ember-resolver';
7-
import { run } from '@ember/runloop';
87

98
module('Unit | Instance Initializer | foo', function (hooks) {
109
hooks.beforeEach(function () {
@@ -26,8 +25,8 @@ module('Unit | Instance Initializer | foo', function (hooks) {
2625
this.instance = this.application.buildInstance();
2726
});
2827
hooks.afterEach(function () {
29-
run(this.instance, 'destroy');
30-
run(this.application, 'destroy');
28+
this.instance.destroy();
29+
this.application.destroy();
3130
});
3231

3332
// TODO: Replace this with your real tests.

node-tests/fixtures/instance-initializer-test/app.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import config from 'my-app/config/environment';
44
import { initialize } from 'my-app/instance-initializers/foo';
55
import { module, test } from 'qunit';
66
import Resolver from 'ember-resolver';
7-
import { run } from '@ember/runloop';
87

98
module('Unit | Instance Initializer | foo', function (hooks) {
109
hooks.beforeEach(function () {
@@ -26,8 +25,8 @@ module('Unit | Instance Initializer | foo', function (hooks) {
2625
this.instance = this.application.buildInstance();
2726
});
2827
hooks.afterEach(function () {
29-
run(this.instance, 'destroy');
30-
run(this.application, 'destroy');
28+
this.instance.destroy();
29+
this.application.destroy();
3130
});
3231

3332
// TODO: Replace this with your real tests.

0 commit comments

Comments
 (0)