mirror of
https://github.com/flarum/core.git
synced 2025-08-10 02:17:37 +02:00
Hello world!
This commit is contained in:
30
ember/tests/helpers/start-app.js
Normal file
30
ember/tests/helpers/start-app.js
Normal file
@@ -0,0 +1,30 @@
|
||||
/* 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;
|
||||
}
|
Reference in New Issue
Block a user