今日已更新 168 条资讯 | 累计 21034 条内容
关于我们

Mocks are the Little-Death: Escaping the Mirage of Green Tests

/u/aijan1 2026年06月06日 17:27 3 次阅读 来源:Reddit r/webdev

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] [留言]

本文内容来源于互联网,版权归原作者所有
查看原文