Created
May 25, 2014 17:45
-
-
Save jgwhite/3392b6663f8480ea237b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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