-
-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Async behavior outside of a test #246
Comments
Totally agreed RE: point 1, I'll make the change in ember-test-helpers... |
emberjs/ember-test-helpers#227 should address |
@trentmwillis - Do you think the changes in emberjs/ember-test-helpers#227 are enough to close this, or should we also continue to figure out your second proposal as well? |
@rwjblue I believe that should fix it |
Thank you sir! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Due to the way RSVP is configured in testing environments and the way ember-qunit's adapter works, it is impossible to define RSVP-based async behavior outside of a test.
As an example, if we want to load some assets before the test run (as we do for ember-engines, currently) then you'll get an error, because
QUnit.config.current
will beundefined
at the moment in which you create anRSVP.Promise
.One option is to move that request into the
beforeEach
hook of the test module, but this is problematic because if you're attempting to preload assets (as in the above case), it is possible that you need to load the asset to prevent one of the other tests from erring out when requiring it.I have two proposed solutions:
Ember.testing
tofalse
untilQUnit.start()
is invoked.asyncStart
/asyncEnd
whenQUnit.config.current
exists.All of this said, I am a bit confused as to why we configure RSVP at all. I think this pattern is likely masking bad asynchronous tests and should be done away with, if possible.
The text was updated successfully, but these errors were encountered: