News for hackers. Stuff that matters.
Re:Idiomatic React Testing Patterns by shepmaster on Wednesday July 13, 2016 @01:55PM (#12088221)
Do you use anything like Redux? When writing Redux state reducers and actions, it all seems so... simple. There's a lot of code like `return { ...currentState, newProp }` which seems too silly to test.
Re:Idiomatic React Testing Patterns by tengbretson on Wednesday July 13, 2016 @02:05PM (#12088311)
I often leave off tests for strictly "synchronous" actions like `return { ...currentState, newProp }`. Most of my tests are for confirming that the right paths are taken for actions that trigger one or more async operations to ensure correct failure case handling.
Re:Idiomatic React Testing Patterns by jfdk on Wednesday July 13, 2016 @02:12PM (#12088374)
JS tests like this are so stupid cheap that we still write them for even the most basic test. Not sure I'm convinced it's worth it yet and I might regret it the first time we refactor a larger reducer.