Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to add example of JS Testing #9

Closed
justin808 opened this issue Dec 30, 2014 · 6 comments
Closed

Need to add example of JS Testing #9

justin808 opened this issue Dec 30, 2014 · 6 comments

Comments

@justin808
Copy link
Member

  1. What JS testing framework should we use?
  2. What other projects could be examples? How about the testing setup here: https://github.com/rackt/react-router

Let's get some simple JS tests that show how this can minimize the need for capybara tests of the ReactJS components.

@justinwoo
Copy link

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.

@onemanstartup
Copy link

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

@acurry
Copy link

acurry commented Mar 2, 2015

@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. 👍

@Johnnycus
Copy link

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.

@geminiyellow
Copy link

@justin808 and now, is some news in here?

@justin808
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants