No animation registred by the name of slightFadeInUp
at getCompiledAnimation (node_modules/react-native-animatable/createAnimatableComponent.js:78:13)
at new AnimatableComponent (node_modules/react-native-animatable/createAnimatableComponent.js:290:201)
at constructClassInstance (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:3459:18)
at updateClassComponent (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:6785:5)
at beginWork (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:7742:16)
at performUnitOfWork (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:11413:12)
at workLoop (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:11445:24)
at renderRoot (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:11528:7)
at performWorkOnRoot (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:12416:7)
at performWork (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:12328:7)
But looks like jest/react-test-renderer cannot see the global animation registrations and raises an exception in below library code:
function getCompiledAnimation(animation) {
if (typeof animation === 'string') {
const compiledAnimation = getAnimationByName(animation);
if (!compiledAnimation) {
throw new Error(`No animation registred by the name of ${animation}`);
}
return compiledAnimation;
}
return createAnimation(animation);
}
If this is a timing issue, I tried below but didn't make a difference:
jest.useFakeTimers();
jest.runAllTimers();
Here's a related thread on different mock examples for react-native-animatable: #97 but none of the solutions worked for me.
Any ideas on how to fix this error? TIA
The text was updated successfully, but these errors were encountered:
Cross-post:
https://stackoverflow.com/questions/58458388/error-testing-animated-react-native-component
Environment: Mac/VSCode with below npm packages:
Tried below in jest config:
Jest error message:
No animation registred by the name of slightFadeInUp
React component code snippet:
Animatable.initializeRegistryWithDefinitions set with:
But looks like jest/react-test-renderer cannot see the global animation registrations and raises an exception in below library code:
If this is a timing issue, I tried below but didn't make a difference:
Here's a related thread on different mock examples for react-native-animatable: #97 but none of the solutions worked for me.
Any ideas on how to fix this error? TIA
The text was updated successfully, but these errors were encountered: