News for hackers. Stuff that matters.
Re:Angular 5.0.0 by FLGMwt on Wednesday November 01, 2017 @05:21PM (#15605584)
That's surprising to me! My main complaints of Angular 2+ are around testing, but I've had nothing but love for React testing (enzyme, chai, karma)

EDIT: whoops, mistyped. We don't use karma anymore in our React testing stack. It's mocha now.

Re:Angular 5.0.0 by Bahamut on Wednesday November 01, 2017 @11:14PM (#15607552)
My gripe with testing in React has a lot to do with testing in JS in general - it avoids the elephant in the room of how to mock dependencies (whether it be functions, classes, etc.), and control various scenarios so you appropriately unit test business logic. One can impose a solution by convention with React, whether it be creating/using a DI mechanism, creating functions that one can pass in dependencies to that returns the desired function, or other numerous ways. Or one can choose to avoid creating a solution and decide not to directly test those scenarios, but then that just leads to more expensive, fragile, and complicated scenarios where one loses the advantage of the fast & tight feedback cycle a unit test gives you.

Angular’s solution of a robust DI mechanism is a little on the heavy side, and the test execution perf is worse than Angular 1’s in general, but it is almost certainly the most powerful test helper situation available for testing frontend JS chrrently.

Note that testing serverside JS doesn’t suffer as much, since there are libraries for making use of the require cache for mocking such as testdouble.

Re:Angular 5.0.0 by vilmosi on Wednesday November 01, 2017 @06:07PM (#15605942)
Chai and karma aren't specific to react. I remember using them with angular 1.x back in the day.
Re:Angular 5.0.0 by FLGMwt on Wednesday November 01, 2017 @07:08PM (#15606325)
Aye, I didn't mean to imply that, I was listing my React testing stack :)

Hah, looking now, I realize I mistyped. We use mocha, not karma. Was conflating things

Re:Angular 5.0.0 by ivankolev on Wednesday November 01, 2017 @06:39PM (#15606139)
I thought Karma was specific to Angular in fact!