'how to use getAnimations in my library without breaking consumers tests?

I am developing a react components library. For some components, I am using getAnimations. As a result, tests are failing for consumers of my library, since the test environment does not have getAnimations defined.

I know that in an ideal world, you would expect the consumers to simply mock my components, but it's a hassle you'd not expect a component library to force you to endure. Plus, it imposes a bigger problem when it comes to E2E/Automations.

What is the best practice in this case? Maybe I should provide a "polyfill" along with my library?

Thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source