Skip to content

Commit

Permalink
jest: Also compile modules in @react-native, which we'll see with RN …
Browse files Browse the repository at this point in the history
…v0.64.

This would be handled already if our transformIgnorePatterns
extended the transformIgnorePatterns in React Native's Jest preset,
because that preset was adapted in facebook/react-native@a77f2c40d,
released in RN v0.64.

It would also be handled already if our transformIgnorePatterns
extended the transformIgnorePatterns in `jest-expo`'s Jest preset
after *that* preset was adapted, in the (as-yet-unreleased) change
in expo/expo@24bce422c.

But we ignore and clobber transformIgnorePatterns in those presets,
because the API just isn't suitable to taking a list from elsewhere
and extending it [1]. So we add this line ourselves.

Since we're upgrading RN before taking that `jest-expo` change,
we'll see the following harmless warning for a while when we run
Jest:

  react-native/jest-preset contained different
    transformIgnorePatterns than expected.

It's harmless because we don't use `jest-expo`'s
transformIgnorePatterns anyway; we fully specify our own instead.

[1] zulip#4991 (comment)

Related: zulip#4426
  • Loading branch information
chrisbobbe committed Sep 8, 2021
1 parent 918ed42 commit 6893690
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const transformModulesWhitelist = [
'expo-application',
'expo-web-browser',
'react-native',
'@react-native',
// @rnc/async-storage itself is precompiled, but its mock-helper is not
'@react-native-async-storage/async-storage',
'@react-native-community/cameraroll',
Expand Down

0 comments on commit 6893690

Please sign in to comment.