Coder Social home page Coder Social logo

Comments (6)

justinwoo avatar justinwoo commented on May 22, 2024

I'd like to chime in just to say that I've been using Jest for a while with my react/webpack application living inside a rails project, and it is really awful. The tests take a long time to run, the errors are not very useful, the test environment barely acts like a real browser, the amount of setup required to get the Jest environment set up is ridiculous, and, most importantly, the documentation on Jest is just not there when I want to look up things (like calling Jest from node).

When I looked at react-router's tests a couple of months ago, they were doing a weird build and pulling in multiple dependencies in a lot of places, but it looks like it's actually gotten quite better in the last week. I definitely recommend copying their setup with webpack building assets and loading them into karma. I had a similar setup previously and it worked quite well, despite a little bit of a hiccup with configuring everything. I really regret investing in Jest, since it has only proven to be painful over time.

Let me know if you'd like to work together on this, since I need something like this for my own uses too.

from react-webpack-rails-tutorial.

onemanstartup avatar onemanstartup commented on May 22, 2024

@kimagure thank you for such information.
I just start with react, but I think mocha with konacha is obvious choice :)

from react-webpack-rails-tutorial.

acurry avatar acurry commented on May 22, 2024

@justin808 I recommend konacha as well. It integrates nicely with sprockets and is easy enough to configure and get up and running with minimal fuss. The in-browser environment is more than suitable for interactive TDD, and the command-line runner works just right.

Right now I'm trying to figure out how to integrate konacha with webpack, via webpack_assets. It's proving tricky... if you or anyone else has any insights, I'd definitely appreciate it. 👍

from react-webpack-rails-tutorial.

Johnnycus avatar Johnnycus commented on May 22, 2024

Jasmine looks good, it's BDD test framework which borrowed many RSpec features and syntax.
And as README on github says: Thus it's suited for websites, Node.js projects. I saw a lot of good comments about Jasmine. Also it has "jasmine-jquery" plugin that simplifies JQuery testing.

Jest looks also good for unit testing ReactJS project. It's provided and used by Facebook. Plus six months passed, maybe Jest became better than @justinwoo described.

from react-webpack-rails-tutorial.

geminiyellow avatar geminiyellow commented on May 22, 2024

@justin808 and now, is some news in here?

from react-webpack-rails-tutorial.

justin808 avatar justin808 commented on May 22, 2024

Here's a few links from @alexfedoseev:

https://reactjsnews.com/testing-in-react/
http://brandonokert.com/2015/08/04/TestingInReact/
http://jaketrent.com/post/testing-react-with-jsdom/

from react-webpack-rails-tutorial.

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.