Ghost/core/client/tests/helpers/module-for-acceptance.js
2015-11-30 11:21:39 -06:00

24 lines
577 B
JavaScript

import { module } from 'qunit';
import startApp from '../helpers/start-app';
import destroyApp from '../helpers/destroy-app';
export default function (name, options = {}) {
module(name, {
beforeEach() {
this.application = startApp();
if (options.beforeEach) {
options.beforeEach.apply(this, arguments);
}
},
afterEach() {
destroyApp(this.application);
if (options.afterEach) {
options.afterEach.apply(this, arguments);
}
}
});
}