Giter Club home page Giter Club logo

Comments (10)

mweststrate avatar mweststrate commented on August 15, 2024

Personally didn't do anything significantly with tape yet, but I think you would at least need to avoid stubbing of the mobservable and mobservable-react packages to test anything useful?

from mobx-react.

bartonhammond avatar bartonhammond commented on August 15, 2024

I don't use Tape, but rather Jest, and I do have those packages called out not to not mock them automatically but I can't get a single test to run. Not sure what the problem is at this time.

from mobx-react.

mweststrate avatar mweststrate commented on August 15, 2024

Do you have a shareable branch somewhere? I can take a look

from mobx-react.

bartonhammond avatar bartonhammond commented on August 15, 2024

Just updated

  • npm install
  • npm test

https://github.com/bartonhammond/mobservable-react-native-counter

from mobx-react.

mweststrate avatar mweststrate commented on August 15, 2024

I saw that some other teams in our company have Jest / React / Mobservable tests, so it is possible at least :)

from mobx-react.

bartonhammond avatar bartonhammond commented on August 15, 2024

I've had nothing but trouble keeping my Jest tests working in my other
project - seems every release of RN breaks something.

Hopefully you find a team that can provide some insight

Thanks for looking at it.

On Tue, Feb 16, 2016 at 8:48 AM, Michel Weststrate <[email protected]

wrote:

I saw that some other teams in our company have Jest / React / Mobservable
tests, so it is possible at least :)

β€”
Reply to this email directly or view it on GitHub
#28 (comment)
.

from mobx-react.

mweststrate avatar mweststrate commented on August 15, 2024

Wow, Jest is a real horror to setup, I changed the setup a bit that got me at least beyond the initial "FAIL" I got without any further error when including components.

See: mweststrate/mobservable-react-native-counter@76dba47

The script preprocesser seems to fix it that at least the tests start when referring to a component. But after that it throws compile errors. Note sure how to setup multiple preprocessors. It seemed that the require('react-native') import in the mobservable-react module broke without the preprocess. But so far Jest is one big mistery for me. I happily continue not using it πŸ˜‰

from mobx-react.

bartonhammond avatar bartonhammond commented on August 15, 2024

Rats! Sorry to hear you didn't make any headway! I had all my fingers and toes crossed.

The ReactJS Conf is going on now - I've been watching it. They haven't mentioned Jest. No surprise -it's the read headed step child.

Once I get my server stuff settled down I want to pick up the mobservable rewrite w/ my Snowflake/Redux app. It would be nice to run tests. Maybe by then I'll have some insights.

from mobx-react.

kitze avatar kitze commented on August 15, 2024

@mweststrate is there any chance that compatibility with Jest will be fixed soon?

from mobx-react.

mweststrate avatar mweststrate commented on August 15, 2024

@kitze From your tweets it seems the question has been answered, but for future reference

jest.mock('react-dom'); seems to be needed (facebook/react#7386). See also https://semaphoreci.com/community/tutorials/how-to-test-react-and-mobx-with-jest

from mobx-react.

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.