Skip to content
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

How to test concurrent rendering? #27

Open
kuraga opened this issue Jan 21, 2016 · 2 comments
Open

How to test concurrent rendering? #27

kuraga opened this issue Jan 21, 2016 · 2 comments

Comments

@kuraga
Copy link

kuraga commented Jan 21, 2016

@Raynos @neonstalwart @Matt-Esch How to test concurrent rendering?

Question is similar to testing of main-loop: http://stackoverflow.com/questions/34862892/test-concurrent-call-of-the-same-function

See, please! Thanks!

@yoshuawuyts
Copy link

@kuraga I'm sorry, I still have no idea what you mean? What do you expect to test?

Because raf ticks asynchronously you can execute unit tests in between tests to assert values; just wrap the tests themselves in raf calls to make them execute on the same tick. Does that answer your question?

@kuraga
Copy link
Author

kuraga commented Jan 22, 2016

@yoshuawuyts big thanks for reading and reply!

I want to test that "render call delays longAction call until current render ends". Every man says "async" but means different 😄

var value = 0;
raf(function () {
  console.log(value);  // logs: 12345678
});
for(; value < 12345678; ++value);

So I can't (without some magic I ask about) start render during render...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants