material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

Add Test Suite

Open skv-headless opened this issue 11 years ago • 11 comments

I think about http://facebook.github.io/jest/

skv-headless avatar Mar 06 '15 15:03 skv-headless

I had issues with jest when I was picking a test suite for a react project a couple months ago. I ended up using mochify which has worked well for my project. My issues with jest were really the limitations of jsdom, which may not be an issue for material-ui.

troutowicz avatar May 15 '15 20:05 troutowicz

The react-bootstrap project uses karma and mocha and it seems to be working well for them

mattapperson avatar Jun 28 '15 23:06 mattapperson

At work I set up mocha/sinon/chai/phantomjs and that's working really well for us. We have a single HTML file that we use as a template (has hooks for the mocha/sinon/global js/css files so that the path can be dynamically inserted) to generate an HTML file per test suite. This allowed us to nest our test structure as deep as we wanted without having to be concerned with keeping an HTML file's paths up to date and managing multiple HTML files.

I would recommend phantomjs over jsdom because phantomjs is a headless browser and does not require node-gyp (maybe when node and io have finished their merge jsdom will not require node-gyp). @hai-cea If this is something you're interested in I can put a PR together.

jkruder avatar Jun 29 '15 00:06 jkruder

We are using jest, but it is extremely slow and memory consuming. We had to change number of concurrent workers because jest was consuming over 4GB of memory (which is a limit in Circle CI). Based on experience in some other projects (e.g. http://www.hammerlab.org/2015/02/14/testing-react-web-apps-with-mocha/) we'll probably test mocha in near future.

mkucharz avatar Jun 29 '15 17:06 mkucharz

@oliviertassinari Would you like to weigh in on which test suite to use? I think this is something we definitely need and is on roadmap.

hai-cea avatar Jul 08 '15 19:07 hai-cea

@hai-cea Sorry, I have never tested react component before.

oliviertassinari avatar Jul 08 '15 21:07 oliviertassinari

I can vote for the solution put forward by @jkruder. Used a similar setup which worked good; especially compared to Jest.

WRidder avatar Jul 08 '15 22:07 WRidder

I also vote for the sollution from @jkruder

mattapperson avatar Jul 08 '15 22:07 mattapperson

http://www.toptal.com/react/how-react-components-make-ui-testing-easy

Uses karma + mocha and makes a case against Jest.

WRidder avatar Jul 09 '15 10:07 WRidder

+1 Free for Open Source: https://www.browserstack.com or https://saucelabs.com/

listepo avatar Jul 31 '15 12:07 listepo

@listepo Already on it. I'm working on integration with saucelabs.

jkruder avatar Aug 01 '15 01:08 jkruder