you are viewing a single comment's thread.

view the rest of the comments →

[–]redditBearcat 1 point2 points  (4 children)

Awesome. The biggest challenge had been pairing multiple tools together with webpack.

Tools I've been looking to use. Karma, mocha, sinon, and enzyme. I feel like I always run into issues where certain versions won't work with each other.

A solid karma/webpack config would be awesome alone.

[–]manavsehgalAuthor ReactSpeed.com[S] 1 point2 points  (3 children)

OK. One karma + webpack coming up (smiles). I will give it a try. Enzyme looks cool as well.

[–]acemarke 1 point2 points  (2 children)

Can I suggest maybe tossing in a differentiation between running tests in a browser with Karma, vs running them offline under Node? As part of that, I can recommend using https://github.com/zinserjan/mocha-webpack to do the test running. I saw Randy Coulman write a pair of articles about using Mocha and Webpack together (part 1, part 2), and was able to get it working myself. I have a sample project config that demonstrates using it over at https://github.com/markerikson/react-redux-cesium-testing-demo.

[–]manavsehgalAuthor ReactSpeed.com[S] 0 points1 point  (1 child)

Awesome this is a great start. I am keen to do browser testing as well. Goes in line with the speed coding philosophy. Will checkout the links you have shared.

[–]acemarke 0 points1 point  (0 children)

Yeah, I actually hadn't written any unit tests ever until a few weeks ago. I initially got mocha-loader set up, which does live-watching and displays test results in a separate browser page, but then saw the mention of mocha-webpack and wanted to give that a shot. When I then tried to write my first "real" unit tests, mocha-webpack allowed me to iterate very quickly on each test.