Velocity 'registerNormalization' warning during Vue Unit Testing
jtotty opened this issue · 2 comments
Your system information
- VelocityJS version: 2.0.5
- Browser: None (Unit Testing with Vue-Test-Utils and Jest within Vue-CLI)
- Operating System: Windows 10
Checklist
- Have you checked for updates?: Yes
- Have you checked for similar open issues?: Yes
Please describe your issue in as much detail as possible:
Running tests using Vue-Test-Utils with Jest on single components that use Velocity.js will print hundreds of VelocityJS: Trying to set 'registerNormalization' constructor to an invalid value: Element
warnings in the terminal. This means any data changes that require Velocity to run will not work.
This occurs even when the Velocity code is not called. I.e the animation should only occur if the user clicks on a specific button.
In situations where tests do not care about Velocity manipulating styles or data changes the sheer amount of warnings is causing the terminal to not display any error messages.
Note: All Velocity implementations in my components seem to be working as normal outside of testing.
Steps for reproducing this issue (code):
- Use Velocity in a Vue Component.
- Try to run a unit test for it.
JSFiddle example showing issue in action (code):
This is an example of the Velocity implementation in my component. This is not a full working component on jsfiddle.
Closed. After further investigation had to mock Velocity in my unit testing.
If there's any ideas for improving testing when using Velocity then feel free to shout - it'll be moving over to internally use Jest when I get the time, and testing with any animation library can be awkward - having some example mock code that actually does specific time intervals etc for consistent test results might be good :-)