-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when using vector-icons component in Jest test with Expo 25 #39
Comments
Also running into this exact error (but with FontAwesome). Environment is jest
jestjs/jest#5108 (comment) implies that maybe the expo/vector-icons repo needs a .babelrc file to work correctly. I forked the repo and tested (wli@b7c0c2b), but it didn't seem to work. For reference, here's the full diff I did: |
@llamaluvr some combination of jest and jest-expo packages seems to have addressed this issue for me. Likely this commit in |
@wli upgrading the jest-expo 25.1.0 fixed it. Thanks! |
How did you do that? |
I just upgraded to Expo 25, and updated react-test-renderer to 16.2.0 to match the updated React version.
A while back when I first added tests for my components that included components from expo/vector-icons, there were the sorts of transform-related errors that I typically see with Jest tests, and I added the package to transformIgnorePatterns in the jest section in package.json and the errors went away:
(see the last match)
As of Expo 25, I now get another error related to the vector-icons library:
For good measure, I tried running jest with --no-cache, but got the same error. Given I've already got expo/vector-icons in my transformIgnorePatterns, I'm not real sure what to do with this, and wondering if anyone has any other ideas. Thanks!
Just to try to see what happens for comparison...
If I remove @expo/vector-icons from transformIgnorePatterns and run Jest with the --no-cache flag, I get (what I believe is) the original error that prompted me to add it in the first place:
The text was updated successfully, but these errors were encountered: