forked from emberjs/ember.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] Update instance-initializer blueprint for ember-mocha 0.14
Related to emberjs#16863
- Loading branch information
1 parent
2d5375a
commit d072143
Showing
4 changed files
with
114 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
...ance-initializer-test/mocha-rfc-232-files/__root__/__testType__/__path__/__name__-test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { expect } from 'chai'; | ||
import { describe, it, beforeEach, afterEach } from 'mocha'; | ||
import Application from '@ember/application'; | ||
import { initialize } from '<%= modulePrefix %>/instance-initializers/<%= dasherizedModuleName %>'; | ||
<% if (destroyAppExists) { %>import destroyApp from '../../helpers/destroy-app';<% } else { %>import { run } from '@ember/runloop';<% } %> | ||
|
||
describe('<%= friendlyTestName %>', function() { | ||
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(); | ||
}); | ||
afterEach(function() { | ||
<% if (destroyAppExists) { %>destroyApp(this.instance);<% } else { %>run(this.instance, 'destroy');<% } %> | ||
<% if (destroyAppExists) { %>destroyApp(this.application);<% } else { %>run(this.application, 'destroy');<% } %> | ||
}); | ||
|
||
// Replace this with your real tests. | ||
it('works', async function() { | ||
await this.instance.boot(); | ||
|
||
expect(true).to.be.ok; | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
node-tests/fixtures/instance-initializer-test/mocha-rfc232.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { expect } from 'chai'; | ||
import { describe, it, beforeEach, afterEach } from 'mocha'; | ||
import Application from '@ember/application'; | ||
import { initialize } from 'my-app/instance-initializers/foo'; | ||
import { run } from '@ember/runloop'; | ||
|
||
describe('Unit | Instance Initializer | foo', function() { | ||
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(); | ||
}); | ||
afterEach(function() { | ||
run(this.instance, 'destroy'); | ||
run(this.application, 'destroy'); | ||
}); | ||
|
||
// Replace this with your real tests. | ||
it('works', async function() { | ||
await this.instance.boot(); | ||
|
||
expect(true).to.be.ok; | ||
}); | ||
}); |
28 changes: 28 additions & 0 deletions
28
node-tests/fixtures/instance-initializer-test/module-unification/mocha-rfc232.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { expect } from 'chai'; | ||
import { describe, it, beforeEach, afterEach } from 'mocha'; | ||
import Application from '@ember/application'; | ||
import { initialize } from 'my-app/init/instance-initializers/foo'; | ||
import { run } from '@ember/runloop'; | ||
|
||
describe('Unit | Instance Initializer | foo', function() { | ||
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(); | ||
}); | ||
afterEach(function() { | ||
run(this.instance, 'destroy'); | ||
run(this.application, 'destroy'); | ||
}); | ||
|
||
// Replace this with your real tests. | ||
it('works', async function() { | ||
await this.instance.boot(); | ||
|
||
expect(true).to.be.ok; | ||
}); | ||
}); |