Files
PyRIGS/tests/helpers/module-for-acceptance.js
Tom Price 8e679b3885 Fix a few ember init fails.
Turns out ember, although defaulting to ECMAScript 6, can't actually write ES6...
2016-08-09 13:34:27 +01:00

25 lines
619 B
JavaScript

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