Open Albert-Gao opened 4 years ago
Have a reproduced repo here: https://github.com/Albert-Gao/react-navigation-test-re-produce
I tried added https://github.com/react-navigation/react-navigation/blob/main/jest/setup.js as one of the jest setup, won't help
Or is it because I miss configuring the jest-expo
in package.json
?
Is this a proper setup for testing react-navigation
with jest-expo
? @EvanBacon
"jest": {
"projects": [
{
"preset": "jest-expo/ios",
"setupFiles": [
"./setup.js"
],
"transformIgnorePatterns": [
"node_modules/(?!(jest-)?react-native|react-clone-referenced-element|@react-native-community|expo(nent)?|@expo(nent)?/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|@sentry/.*)"
]
},
{
"preset": "jest-expo/android",
"setupFiles": [
"./setup.js"
],
"transformIgnorePatterns": [
"node_modules/(?!(jest-)?react-native|react-clone-referenced-element|@react-native-community|expo(nent)?|@expo(nent)?/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|@sentry/.*)"
]
},
{
"preset": "jest-expo/web",
"setupFiles": [
"./setup.js"
],
"transformIgnorePatterns": [
"node_modules/(?!(jest-)?react-native|react-clone-referenced-element|@react-native-community|expo(nent)?|@expo(nent)?/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|@sentry/.*)"
]
}
]
}
expo-cli version: 3.22.3
Created a managed TS project:
package.json
setup.js for jest
from https://reactnavigation.org/docs/testing/
App.tsx
App.test.tsx
Outcome:
Android and iOS are passing while Web is failing.
Only the web is failing, what am I missing here? Thanks