AppAndFlow/react-native-safe-area-context

Jest mock "TypeError: Cannot read properties of undefined (reading 'top')"

Open

#551 geöffnet am 12. Nov. 2024

Auf GitHub ansehen
 (9 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)TypeScript (249 Forks)github user discovery
help wanted

Repository-Metriken

Stars
 (2.727 Stars)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

When upgrading from 4.13.0 to 4.13.1, start facing a TypeError due to a recent mock update https://github.com/th3rdwave/react-native-safe-area-context/pull/449

Following the guide, I included the react-native-safe-area-context to my transformIgnorePatterns

transformIgnorePatterns: [
    "node_modules/(?!react-|@react-native-community|react-native-safe-area-context|victory|rn-placeholder|redux-persist|@react-navigation|@sentry/react-native|@react-native|mixpanel-react-native|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|react-native-svg|@notifee|stream-chat-expo|@rneui/base|@datadog/mobile-react-native/jest/mock).+\\.js$",
  ],
 TypeError: Cannot read properties of undefined (reading 'top')

      23 |   }
      24 |   const Ui = ui as ReactElement<unknown>;
    > 25 |   render(Ui, { wrapper });

Contributor Guide