resetpublic
Reset the application. This is typically used only in tests. It cleans up the application in the following order:
- Deactivate existing routes
- Destroy all objects in the container
- Create a new application container
- Re-route to the existing url
Typical Example:
let App; run(function() { App = Ember.Application.create(); }); module('acceptance test', { setup: function() { App.reset(); } }); test('first test', function() { // App is freshly reset }); test('second test', function() { // App is again freshly reset });
Advanced Example:
Occasionally you may want to prevent the app from initializing during setup. This could enable extra configuration, or enable asserting prior to the app becoming ready.
let App; run(function() { App = Ember.Application.create(); }); module('acceptance test', { setup: function() { run(function() { App.reset(); App.deferReadiness(); }); } }); test('first test', function() { ok(true, 'something before app is initialized'); run(function() { App.advanceReadiness(); }); ok(true, 'something after app is initialized'); });
Please login to continue.