Mocks are the Little-Death: Escaping the Mirage of Green Tests
I grew tired of mocks lying to me and the extra complexity they bring. This led me back to a classic design pattern: the Command. The idea is simple: separate an action from its execution. I wanted a functional take on this, though: no classes, no mutation, just pure functions returning plain data. Most importantly, I wanted it without the academic vocabulary of category theory. The result is a tiny library a developer could master in a single afternoon. It removes the need for mocking libraries and comes with additional benefits such as time-travel debugging. submitted by /u/aijan1 [link] [留言]
本文内容来源于互联网,版权归原作者所有
查看原文