-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
/
Copy path__name__-test.js
28 lines (24 loc) · 1.1 KB
/
__name__-test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import Application from '@ember/application';
import { initialize } from '<%= dasherizedModulePrefix %>/instance-initializers/<%= dasherizedModuleName %>';
import { module, test } from 'qunit';
<% if (destroyAppExists) { %>import destroyApp from '../../helpers/destroy-app';<% } else { %>import { run } from '@ember/runloop';<% } %>
module('<%= friendlyTestName %>', function(hooks) {
hooks.beforeEach(function() {
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() {
<% if (destroyAppExists) { %>destroyApp(this.application);<% } else { %>run(this.application, 'destroy');<% } %>
<% if (destroyAppExists) { %>destroyApp(this.instance);<% } else { %>run(this.instance, 'destroy');<% } %>
});
// Replace this with your real tests.
test('it works', async function(assert) {
await this.instance.boot();
assert.ok(true);
});
});