1
0
Fork 0
mirror of https://github.com/TryGhost/Ghost-Admin.git synced 2023-12-14 02:33:04 +01:00
Ghost-Admin/tests/helpers/start-app.js
2018-01-03 15:02:38 +00:00

22 lines
831 B
JavaScript

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 'ember-power-select/test-support/helpers';
import {assign} from '@ember/polyfills';
import {run} from '@ember/runloop';
registerPowerSelectHelpers();
registerPowerDatepickerHelpers();
export default function startApp(attrs) {
let attributes = assign({}, config.APP);
attributes = assign(attributes, attrs); // use defaults, but you can override;
return run(() => {
let application = Application.create(attributes);
application.setupForTesting();
application.injectTestHelpers();
return application;
});
}