decide.nolog.cz/tests/helpers/start-app.js

27 lines
740 B
JavaScript
Raw Normal View History

2014-10-30 21:44:22 +01:00
import Ember from 'ember';
import registerAcceptanceTestHelpers from './201-created/register-acceptance-test-helpers';
2014-10-30 21:44:22 +01:00
import Application from '../../app';
import config from '../../config/environment';
2015-10-16 11:21:06 +02:00
import './poll-has-users';
import './poll-participate';
import './switch-tab';
2015-11-20 02:18:19 +01:00
import './t';
2016-04-11 00:37:46 +02:00
import './browser-navigation-buttons';
2014-07-06 17:37:54 +02:00
registerAcceptanceTestHelpers();
2014-10-30 21:44:22 +01:00
export default function startApp(attrs) {
2015-12-07 20:24:22 +01:00
let application;
2014-07-06 17:37:54 +02:00
2015-12-07 20:24:22 +01:00
let attributes = Ember.merge({}, config.APP);
2014-10-30 21:44:22 +01:00
attributes = Ember.merge(attributes, attrs); // use defaults, but you can override;
2014-07-06 17:37:54 +02:00
2015-12-07 20:24:22 +01:00
Ember.run(() => {
application = Application.create(attributes);
application.setupForTesting();
application.injectTestHelpers();
2014-07-06 17:37:54 +02:00
});
return application;
2014-07-06 17:37:54 +02:00
}