mirror of
https://github.com/flarum/framework.git
synced 2024-12-15 08:33:38 +08:00
31 lines
692 B
JavaScript
31 lines
692 B
JavaScript
/* global require */
|
|
|
|
var Application = require('flarum/app')['default'];
|
|
var Router = require('flarum/router')['default'];
|
|
import Ember from 'ember';
|
|
|
|
export default function startApp(attrs) {
|
|
var App;
|
|
|
|
var attributes = Ember.merge({
|
|
// useful Test defaults
|
|
rootElement: '#ember-testing',
|
|
LOG_ACTIVE_GENERATION:false,
|
|
LOG_VIEW_LOOKUPS: false
|
|
}, attrs); // but you can override;
|
|
|
|
Router.reopen({
|
|
location: 'none'
|
|
});
|
|
|
|
Ember.run(function(){
|
|
App = Application.create(attributes);
|
|
App.setupForTesting();
|
|
App.injectTestHelpers();
|
|
});
|
|
|
|
App.reset(); // this shouldn't be needed, i want to be able to "start an app at a specific URL"
|
|
|
|
return App;
|
|
}
|