0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00
ghost/core/client/tests/helpers/start-app.js

22 lines
530 B
JavaScript
Raw Normal View History

2015-02-12 21:22:32 -07:00
import Ember from 'ember';
import Application from '../../app';
import config from '../../config/environment';
2016-04-15 00:24:57 -05:00
const {assign, run} = Ember;
export default function startApp(attrs) {
2016-04-15 00:24:57 -05:00
let attributes = assign({}, config.APP);
let application;
2015-02-12 21:22:32 -07:00
// use defaults, but you can override;
2016-04-15 00:24:57 -05:00
attributes = assign(attributes, attrs);
2015-02-12 21:22:32 -07:00
run(function () {
application = Application.create(attributes);
application.setupForTesting();
application.injectTestHelpers();
});
2015-02-12 21:22:32 -07:00
return application;
2015-02-12 21:22:32 -07:00
}