Skip to content
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

[expo-localization] Incompatibility with Jest 26+ #9120

Closed
Shizerq opened this issue Jul 7, 2020 · 2 comments
Closed

[expo-localization] Incompatibility with Jest 26+ #9120

Shizerq opened this issue Jul 7, 2020 · 2 comments
Assignees
Labels
Jest with Expo Pertains to using Jest with an Expo project. Localization

Comments

@Shizerq
Copy link
Contributor

Shizerq commented Jul 7, 2020

🐛 Bug Report

Summary of Issue

Running unit tests of components, that use expo-localization ends with error caused by removing require.requireActual
in Jest 26+ (jestjs/jest/pull/9854

Steps to Reproduce

Write unit tests with Jest for components, that use expo-localization and simply run them.

Expected Behavior vs Actual Behavior

Expected: working tests

Actual behavior:

  ● Test suite failed to run

    TypeError: require.requireActual is not a function

    > 1 | import * as Localization from "expo-localization";
        | ^

@Shizerq Shizerq added the needs validation Issue needs to be validated label Jul 7, 2020
@Shizerq Shizerq changed the title [expo-localization] Incompatibility with Jest 37+ [expo-localization] Incompatibility with Jest 26+ Jul 7, 2020
@AdamJNavarro AdamJNavarro added Jest with Expo Pertains to using Jest with an Expo project. Localization and removed needs validation Issue needs to be validated labels Jul 7, 2020
@byCedric byCedric self-assigned this Jul 7, 2020
@byCedric
Copy link
Member

byCedric commented Jul 7, 2020

Hi @Shizerq, thanks for your issue report. We have patched the usage of require.requireActual in this PR, and should be included in SDK 38. I'm not sure what you are currently using, but upgrading to 38 should fix this for you.

I'm not sure why you get this error in expo-localization. The tests in that one shouldn't run in your project. We did have some traces of require.requireActual in jest-expo, I think that's the origin of your error (but correct me if I'm wrong).

Hope this helps!

@byCedric byCedric closed this as completed Jul 7, 2020
@leonaburime
Copy link

Hi @byCedric, I have the exact same problem and am using "expo": "^38.0.0". Im trying to run jest tests and installed everything on this page

Screen Shot 2020-09-20 at 9 46 42 PM

What else can I do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Jest with Expo Pertains to using Jest with an Expo project. Localization
Projects
None yet
Development

No branches or pull requests

4 participants