Re:Zen and the Art of Unit Testing
by lmm on Wednesday March 15, 2017 @11:55AM
(#13876977)
Monads. Possibly the Free Monad. Make your business logic pure logic that computes commands, and separate the computation of the command from its execution, then you can use a different execution to test your command chains. http://michaelxavier.net/posts/2014-04-27-Cool-Idea-Free-Mon... has a basic example, but it works well for replacing your services/controllers/what-have-you too.
[ Parent
| on HN ]
There are no comments on this comment yet.