Comments (3)
This is a feature we will explore in the future but as @amandeepmittal stated, for now you'll need to perform the second approach.
Testing with React Native isn't as simple as a single .test
file, as due to the multi-platform nature of Expo Router you'll most likely have multiple .test.ios
/.test.android
/.test.web
files. Is having a 1:3 route:test file ratio good? We're a bit worried that it bloats the app
and makes locating files harder in larger projects.
Also the current standard is using -test.ios
(see jest-expo), so there's also a compatibility issue (what is someone wants a -test
route?)
from expo.
Hi @OoDeLally, thanks for sharing the reproducible example. It was very helpful!
You're getting the error following the first approach from the Unit Testing guide because any file inside the app
directory is considered to be part of the bundle when using the Expo Router library. In other words, the library doesn't ignore the *.test.*
file pattern. This is also why the second approach works, where the test files are not included in the app
directory.
You'll have to continue using the second approach and only include test files outside the app
directory. Meanwhile, we'll call this out in our docs so that any subsequent developers are mindful of this issue and also look into respect patterns specified by Jest on the library level.
from expo.
Thank you for filing this issue!
This comment acknowledges we believe this may be a bug and there’s enough information to investigate it.
However, we can’t promise any sort of timeline for resolution. We prioritize issues based on severity, breadth of impact, and alignment with our roadmap. If you’d like to help move it more quickly, you can continue to investigate it more deeply and/or you can open a pull request that fixes the cause.
from expo.
Related Issues (20)
- [docs] ImagePicker result on some android devices is "filesize" and not "fileSize" HOT 1
- Unmatched Route HOT 1
- Response in network tab is blob instead of json HOT 1
- expo-font 12.0.5 HOT 9
- [expo-media-library][iOS] No suitable URL request handler found Expo 51 HOT 3
- Response in network tab is blob instead of json HOT 1
- [expo-51] Android app unable to resolve module expo-router/entry inside monorepo (new arch enabled or not) HOT 2
- Measuring Distance from the Floor in Expo/React Native HOT 1
- Error: Cannot find native module 'ExpoApplication', js engine: hermes HOT 1
- [expo-51] Build error with PrivacyInfo.xcprivacy after upgrading to SDK 51 HOT 1
- Connected iPhone not showing up on expo run devices list for development build HOT 5
- [create-expo-module] Could not find method publishing() HOT 5
- [SDK 51][expo-web] @apollo-client fails during expo export with metro for web HOT 2
- [SDK50][expo-updates] Request for assistance with expo-updates in SDK 50 without --public-url HOT 1
- Could not determine the dependencies of null. > Could not resolve all dependencies for configuration ':classpath'. HOT 1
- expo-camera doesn't work HOT 1
- [SDK 51][Android][Expo Go] Screen orientation change listener not firing
- Expo Camera No Longer Captures Sound HOT 2
- npx expo lint gives a maximum call stack size exceeded HOT 2
- Hi guys, wouldn't MMKV be a better option than AsyncStorage? Why isn't he at Expo Management? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from expo.