Fix a few ember init fails.

Turns out ember, although defaulting to ECMAScript 6, can't actually write ES6...
This commit is contained in:
Tom Price
2016-08-09 13:34:27 +01:00
parent bfdf0cabbe
commit 8e679b3885
2 changed files with 12 additions and 12 deletions

View File

@@ -1,7 +1,7 @@
import {module} from 'qunit'; import {module} from "qunit";
import Ember from 'ember'; import Ember from "ember";
import startApp from '../helpers/start-app'; import startApp from "../helpers/start-app";
import destroyApp from '../helpers/destroy-app'; import destroyApp from "../helpers/destroy-app";
const {RSVP: {Promise}} = Ember; const {RSVP: {Promise}} = Ember;
@@ -17,8 +17,8 @@ export default function (name, options = {}) {
afterEach() { afterEach() {
let afterEach = options.afterEach && options.afterEach.apply(this, arguments); let afterEach = options.afterEach && options.afterEach.apply(this, arguments);
return Promise.resolve(afterEach).then(() = > destroyApp(this.application) return Promise.resolve(afterEach).then(() => destroyApp(this.application)
) );
}; }
}); });
} }

View File

@@ -1,6 +1,6 @@
import Ember from 'ember'; import Ember from "ember";
import Application from '../../app'; import Application from "../../app";
import config from '../../config/environment'; import config from "../../config/environment";
export default function startApp(attrs) { export default function startApp(attrs) {
let application; let application;
@@ -8,10 +8,10 @@ export default function startApp(attrs) {
let attributes = Ember.merge({}, config.APP); let attributes = Ember.merge({}, config.APP);
attributes = Ember.merge(attributes, attrs); // use defaults, but you can override; attributes = Ember.merge(attributes, attrs); // use defaults, but you can override;
Ember.run(() = > { Ember.run(() => {
application = Application.create(attributes); application = Application.create(attributes);
application.setupForTesting(); application.setupForTesting();
application.injectTestHelpers(); application.injectTestHelpers();
}) });
return application; return application;
} }