You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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";
| ^
The text was updated successfully, but these errors were encountered:
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).
🐛 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:
The text was updated successfully, but these errors were encountered: