Giter Club home page Giter Club logo

Comments (3)

marklawlor avatar marklawlor commented on May 24, 2024 2

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.

amandeepmittal avatar amandeepmittal commented on May 24, 2024 1

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.

expo-bot avatar expo-bot commented on May 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.