Skip to content

Instantly share code, notes, and snippets.

@jgwhite
Created May 25, 2014 17:45
Show Gist options
  • Save jgwhite/3392b6663f8480ea237b to your computer and use it in GitHub Desktop.
Save jgwhite/3392b6663f8480ea237b to your computer and use it in GitHub Desktop.
/* global require */
var Application = require('my-app/app')['default'];
var Router = require('my-app/router')['default'];
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,
// Override application adapter in test environment
ready: function() {
this.register('adapter:application', DS.FixtureAdapter);
}
}, 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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment