Ghost/ghost/admin/tests/helpers/start-app.js

23 lines
825 B
JavaScript
Raw Normal View History

2015-02-13 07:22:32 +03:00
import Application from '../../app';
import config from '../../config/environment';
import fileUpload from './file-upload'; // eslint-disable-line
import registerPowerDatepickerHelpers from '../../tests/helpers/ember-power-datepicker';
import registerPowerSelectHelpers from '../../tests/helpers/ember-power-select';
import run from 'ember-runloop';
import {assign} from 'ember-platform';
2015-02-13 07:22:32 +03:00
registerPowerSelectHelpers();
registerPowerDatepickerHelpers();
export default function startApp(attrs) {
2017-01-19 16:31:56 +03:00
let attributes = assign({}, config.APP);
attributes = assign(attributes, attrs); // use defaults, but you can override;
2015-02-13 07:22:32 +03:00
return run(() => {
let application = Application.create(attributes);
application.setupForTesting();
application.injectTestHelpers();
return application;
});
2015-02-13 07:22:32 +03:00
}