Comments (6)
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.
@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.
@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.
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.
@justin808 and now, is some news in here?
from react-webpack-rails-tutorial.
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)
- Component Comment.jsx is using an insecure method to sanitize input --could suffer XSS atacks
- "Getting Started" doc not updated
- Provide example with react-rails HOT 2
- Update Rails 7, Ruby 3.1, and add ruby-debug gem HOT 1
- Clean up docs for react-webpack-rails-tutorial HOT 1
- Convert to Tailwind
- Separate workflows
- Migrate from Heroku to Control Plane HOT 1
- Replace `xvfb-action` with `coactions/setup-xvfb`
- The README.md file link in the docs/linters.md is outdated
- Update old documentation HOT 1
- Improve tests consistency HOT 1
- Resolve flashing while loading the page
- Rails 7 Jbuilder ActionView::MissingTemplate Error HOT 1
- Update to Rails 7.1
- Fix issues with Redis HOT 1
- Fix i18n issue (Missing locale)
- Not getting live comments on the ReScript page HOT 1
- No commit hash on the deployed project
- Add CI for auto deployment to ControlPlane HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-webpack-rails-tutorial.