-
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
Add unit/integration tests #3
Comments
About the idea of reusing WPT idea. @flackr pointed out that web-animations-js polyfill is doing something like this. The tricky bit is that we need to load the polyfill before the test runs. AFAICT, they are using Karma and configure that to load their own special testharnessreport.js that injects the polyfill using document.write() . This works because every wpt test loads testharnessreport.js at the top of the test. Note that to use the above technique, there may be a need to change the polyfill so that it can be loaded synchronously though. From @flackr :
|
@zouhir Is this complete now? |
Yes, having I recall we agreed in a past Slack conversation that local unit-tests are redundant given we run WPT. Do you still think so? |
Yes, I think so! Thanks again for all your work here. We can close the dependent testing bugs too right? |
Yep! |
Currently the polyfill does not have any tests.
I suggest we look into adding test and setting up a CI pipeline to check new commits against those tests.
Tests
Should be fairly easy to add some basic tests around timeline time calculations and animations correctly running.
One idea is to import/adapt the wpt tests for ScrollTimeline and run them against the polyfill. I haven't fully thought this through but it seems possible albeit may require us to change tests in a way that we can't easily keep syncing them.
Test harness and CI
Key requirement here is to be able to test against all mainstream browsers.
In the past I have had success using Karma testing framework in conjunction with Sauce Labs to run tests against multiple browsers. But this was some times ago and there may be better solutions now.
The text was updated successfully, but these errors were encountered: