Giter VIP home page Giter VIP logo

Comments (5)

RealOrangeOne avatar RealOrangeOne commented on August 14, 2024

I'm not sure youre meant to be importing things from react native with paths like that. You should probably be getting the components from the keys of react-native itself. As our project doesnt use the same directory structure as react-native, this is unlikely to work. Are the modules youre getting from libs/ available off react-native?

from react-native-mock.

joncursi avatar joncursi commented on August 14, 2024

That's the interesting thing! I'm only importing standard components from the React Native docs, so I'm trying to figure out why my test setup is getting tripped up on react native internals. I figured this could be due to the RN 0.33.0 upgrade and the way this package handles that, but it looks like I was wrong. I'll continue to investigate in my repo and report back any findings.

Thanks!

from react-native-mock.

RealOrangeOne avatar RealOrangeOne commented on August 14, 2024

during tests, you shouldnt be touching react-native itself at all. So i'm confused why this is a problem with versions of react-native. I can only presume that you are somewhere requiring like that with paths.

from react-native-mock.

joncursi avatar joncursi commented on August 14, 2024

Ah, so it turns out this issue was being caused by react-native-svg.

The following snippet inside mocha's setup.js fixed the issue:

import mockery from 'mockery';

...

mockery.registerMock('react-native-svg', () => null);

Sorry for logging this where it didn't belong!

from react-native-mock.

RealOrangeOne avatar RealOrangeOne commented on August 14, 2024

Great. I would also be tempted to open an issue against react-native-svg, as they really shouldnt be importing react-native things like that

from react-native-mock.

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.