Skip to content

Instantly share code, notes, and snippets.

@mars
Last active December 20, 2015 06:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mars/6086282 to your computer and use it in GitHub Desktop.
Save mars/6086282 to your computer and use it in GitHub Desktop.
ember-testing: multiple app compatibility
// give each tested app its own DOM element
document.write('<div class="ember-testing-container"><div id="foo-app-testing"></div></div>');
FooApp.rootElement = '#foo-app-testing';
// defer readiness
FooApp.setupForTesting();
module("Foo App", {
setup: function() {
FooApp.injectTestHelpers();
// last step, before each test begins, clears the container and advances readiness
FooApp.reset();
},
teardown: function() {
// clear the helpers everytime so that a different app can inject them
FooApp.removeTestHelpers();
}
});
@mars
Copy link
Author

mars commented Sep 25, 2013

Updated for Ember 1.0.0 stable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment