With https://github.com/apexcharts/apexcharts.js/pull/4515 the tests passed locally, but ever since then some tests (mostly funnel/funnel, funnel/pyramid, and line/line-with-annotations) would sometimes fail spontaneously and running the tests again with no code changes would fix the error. Adding a while loop to wait for all timers/intervals/network requests and the chart animation to end fixes the reliability issues.
This change would also improve reliability for future possible tests, like for example if a test needed a timeout after the chart animation ended, the test would not wait for that timeout because it had already waited for all timeouts to finish. With this PR, if a timeout is created after a chart animation ends, the test would wait for the timeout to end before continuing.
Type of change
[x] Bug fix (non-breaking change which fixes an issue)
Checklist:
[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my own code
[x] I have commented my code, particularly in hard-to-understand areas
[x] My changes generate no new warnings
[x] New and existing unit tests pass locally with my changes
With https://github.com/apexcharts/apexcharts.js/pull/4515 the tests passed locally, but ever since then some tests (mostly funnel/funnel, funnel/pyramid, and line/line-with-annotations) would sometimes fail spontaneously and running the tests again with no code changes would fix the error. Adding a while loop to wait for all timers/intervals/network requests and the chart animation to end fixes the reliability issues. This change would also improve reliability for future possible tests, like for example if a test needed a timeout after the chart animation ended, the test would not wait for that timeout because it had already waited for all timeouts to finish. With this PR, if a timeout is created after a chart animation ends, the test would wait for the timeout to end before continuing.
Type of change
Checklist: