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

25 lines
736 B
JavaScript
Raw Normal View History

import {assign} from 'ember-platform';
import run from 'ember-runloop';
2015-02-13 07:22:32 +03:00
import Application from '../../app';
import config from '../../config/environment';
import registerPowerSelectHelpers from '../../tests/helpers/ember-power-select';
// eslint-disable-next-line no-unused-vars
import fileUpload from './file-upload';
2015-02-13 07:22:32 +03:00
registerPowerSelectHelpers();
export default function startApp(attrs) {
let application;
2015-02-13 07:22:32 +03:00
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
run(function () {
application = Application.create(attributes);
application.setupForTesting();
application.injectTestHelpers();
});
2015-02-13 07:22:32 +03:00
return application;
2015-02-13 07:22:32 +03:00
}