MAINT: Upgrade ember to 2.14 (#10)
This commit is contained in:
parent
d58b4e218c
commit
4c58b0c331
14 changed files with 84 additions and 62 deletions
|
@ -3,7 +3,7 @@ import Ember from 'ember';
|
|||
import startApp from '../helpers/start-app';
|
||||
import destroyApp from '../helpers/destroy-app';
|
||||
|
||||
const { RSVP: { Promise } } = Ember;
|
||||
const { RSVP: { resolve } } = Ember;
|
||||
|
||||
export default function(name, options = {}) {
|
||||
module(name, {
|
||||
|
@ -17,7 +17,7 @@ export default function(name, options = {}) {
|
|||
|
||||
afterEach() {
|
||||
let afterEach = options.afterEach && options.afterEach.apply(this, arguments);
|
||||
return Promise.resolve(afterEach).then(() => destroyApp(this.application));
|
||||
return resolve(afterEach).then(() => destroyApp(this.application));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -3,16 +3,13 @@ import Application from '../../app';
|
|||
import config from '../../config/environment';
|
||||
|
||||
export default function startApp(attrs) {
|
||||
let application;
|
||||
|
||||
let attributes = Ember.merge({}, config.APP);
|
||||
attributes = Ember.merge(attributes, attrs); // use defaults, but you can override;
|
||||
|
||||
Ember.run(() => {
|
||||
application = Application.create(attributes);
|
||||
return Ember.run(() => {
|
||||
let application = Application.create(attributes);
|
||||
application.setupForTesting();
|
||||
application.injectTestHelpers();
|
||||
return application;
|
||||
});
|
||||
|
||||
return application;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue