-
-
Notifications
You must be signed in to change notification settings - Fork 84
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
Fallback to setTimeout if requestAnimationFrame is not present #84
Conversation
}); | ||
|
||
test('works without requestAnimationFrame', function(assert) { | ||
var originalRaf = window.requestAnimationFrame; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this setup/teardown should be in setup/teardown of the module, otherwise it is possible for a failure to prevent restoration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had that but I can't get the teardown to wait for the component to be torn down, so the restoration happens causing the test to fail. Async is hard.
Trying to figure it out now.
340924f
to
6a47331
Compare
Needed to call |
After chatting with @raytiley about the issue of forcing the test module's component to be destroyed, we discovered that it is not currently possible to actually run assertions after the component is destroyed! I am working up a PR to |
For now, wrapping in an Thanks to @mmun for that suggestion. |
This is mostly to allow tests to run in PhantomJS without requring a 'requestAnimationFrame' pollyfill. Closes adopted-ember-addons#43. The weirdness in the test is because there is no way currently to make sure the component is cleared and destroyed before the module's teardown hook is called. Wrapping the component in an if is a workaround until this: https://github.com/switchfly/ember-test-helpers/pull/147/files lands.
6a47331
to
f35bf59
Compare
This seems good to me. I'm definitely in the camp of folks that would be happy if this worked out of the box: ember new foo
cd foo
ember install ember-collection
ember test |
@lukemelia / @krisselden / @stefanpenner - Any objections to this? |
Fallback to setTimeout if requestAnimationFrame is not present
This is mostly to allow tests to run in PhantomJS without requring a 'requestAnimationFrame' pollyfill. Closes #43.