Open Crizzooo opened 7 years ago
Since React Anime is a DOM based library, it might not work with test suites. There's some tricks to get around that that I'll try to implement though.
In the meantime for the test case at least, try not to use React Anime in it.
Just three years late with this reply but:
I had the same problem with animejs in a different context. I find it helpful to abstract my animation methods to a helper class and then stub them out.
In a before or beforeEach:
sinon.stub(AnimationHelper.prototype, 'someAnimationMethod');
And in the corresponding after or afterEach:
AnimationHelper.prototype.someAnimationMethod.restore();
And you can do all the sinon spying and faking you want.
(I'm not currently working with React though so I couldn't say how helpful this approach would be there)
Hey,
I am trying to write tests to check the state changes of my component on mouse enter.
When I run the little bit of code, I get an error 'NodeList is not defined' from Line 219 of /dist/anime.js. I was able to alter the source code to get passed this function if of unknownHTMLElement type, but then I hit a tags button elsewhere in the anime.js source code.
Ive tried many different approaches and cant find a way to simulate this mouseEnter.
What's the current recommended solution for testing components that use Anime components?
Full Error Log: