Last active
December 20, 2015 06:29
-
-
Save mars/6086282 to your computer and use it in GitHub Desktop.
ember-testing: multiple app compatibility
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
// 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(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updated for Ember 1.0.0 stable.