Closed vjmanlapaz-nuskin closed 2 years ago
I’ve never used Jest so I’m not sure, but did you search the other issues? I think this came up before. You might need to transpile Moti.
i did find the previous issue related to this and tried it out but did not work, i still get the same error.
the error message says you need to add libs to transform. did you try that?
I think you aren't testing the animation, then you need to mock it creating __mocks__/moti.ts
with
import { View as MotiView } from 'react-native';
export { MotiView };
If you are using other components or hooks, you need to mock them as well.
late to the party but here's how I did it.
jest.mock('moti', () => ({MotiView: () => 'MotiView'}));
I'm writing some test for my component using jest, and i came across an issue that says
Jest encountered an unexpected token
and it's pointing to mymoti
import.Im not sure how to fix this. please help.