News for hackers. Stuff that matters.
Re:A Primer for Building Single Page Applications with React by masklinn on Tuesday March 24, 2015 @09:42AM (#9256452)
> Do people generally write tests for these components?

Sure. React even ships with testing utilities to make that easier: http://facebook.github.io/react/docs/test-utils.html

> I'm wondering how the marrying of presentation and logic affects that.

Depends on the exact component. For pure components as part of bigger applications it's really quite easy, just render the component with a known dataset and see if it's got everything where things should be. Then again, that's similar to testing templates… most people don't really test their templates.

For self-contained "widget" components things are a bit harder, it's similar to testing DOM-based widgets really.

There are no comments on this comment yet.