Giter VIP home page Giter VIP logo

Comments (11)

RealOrangeOne avatar RealOrangeOne commented on September 17, 2024

I did not know about this global, and I don't believe it's documented. Do you know what it does? So we can make an accurate mock

from react-native-mock.

ZauberNerd avatar ZauberNerd commented on September 17, 2024

Seems like it's inspired by the browser FormData API: https://developer.mozilla.org/en-US/docs/Web/API/FormData
Here's the react-native implementation: https://github.com/facebook/react-native/blob/9ee815f6b52e0c2417c04e5a05e1e31df26daed2/Libraries/Network/FormData.js

from react-native-mock.

RealOrangeOne avatar RealOrangeOne commented on September 17, 2024

Ah ok. Looks like it's something that's very easy to add

from react-native-mock.

GeoffreyPlitt avatar GeoffreyPlitt commented on September 17, 2024

Sweet

from react-native-mock.

cubbuk avatar cubbuk commented on September 17, 2024

I have a several issue with RNGoogleSignin component. I extended the current package in an initial config file similar to following, is there anything wrong with this approach I was getting an error while trying to run tests due to missign RNGoogleSignin:

import ReactNativeMock from "react-native-mock";
import "react-native-mock/mock";
ReactNativeMock.NativeModules.RNGoogleSignin = {};

from react-native-mock.

RealOrangeOne avatar RealOrangeOne commented on September 17, 2024

@cubbuk You probably shouldnt do it like that. If you just run the mock script. then extend NativeModules off react-naive instead of react-native-mock, it should work

from react-native-mock.

cubbuk avatar cubbuk commented on September 17, 2024

@RealOrangeOne But isn't the idea of ReactNativeMock is to replace import statements to ReactNative to point to itself? If I extend ReactNative rather than the mock, the require statements on missing components will throw exception. Maybe I am just confused about the library let me know If I didn't make sense.

from react-native-mock.

RealOrangeOne avatar RealOrangeOne commented on September 17, 2024

I think you may be. We're changing the require path yes. But you shouldnt be mutating our library directly. You should be running mock, the changing react-native itself afterwards.

from react-native-mock.

taylesworth avatar taylesworth commented on September 17, 2024

Is there any reason this isn't as simple as just adding the React Native implementation to react-native-mock? If that's all that's required, I'm happy to put together a PR.

from react-native-mock.

RealOrangeOne avatar RealOrangeOne commented on September 17, 2024

@taylesworth Yes, it should be just that simple. Provided it's mocked in an identical way.

from react-native-mock.

taylesworth avatar taylesworth commented on September 17, 2024

Do you have an eta for a release containing FormData?

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.