Ghost/core/client/tests/helpers/start-app.js

22 lines
527 B
JavaScript
Raw Normal View History

2015-02-13 07:22:32 +03:00
import Ember from 'ember';
import Application from '../../app';
import config from '../../config/environment';
const {merge, run} = Ember;
export default function startApp(attrs) {
let attributes = merge({}, config.APP);
let application;
2015-02-13 07:22:32 +03:00
// use defaults, but you can override;
attributes = merge(attributes, attrs);
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
}