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

Allow mocking of 'requestAnimationFrame' #47

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

yelper
Copy link

@yelper yelper commented Apr 27, 2021

Hey, this is quite a minor change -- I'm fine if you don't take it.

However, we've found (in Power BI visual development) that mocking requestAnimationFrame() allows us to "speed" through d3.transitions() in our unit tests. We've made this change locally for our d3's distribution, I thought it might be useful to share here.

We use jasmine's clock to tick forward in time. We also use a "Scheduler" class to mock RAF to execute immediately, so we also make this change in the d3 source. Again, this is a "testability"-only change that may be useful to others mocking time in unit tests :)

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

Successfully merging this pull request may close these issues.

1 participant