Tag: Testing
All the articles with the tag "Testing".
- Featured
Break Your Own Code First: Property-Based Testing in TypeScript
Your tests pass because you chose the inputs, and you chose them with the same mental model that wrote the bug. State the law instead and let a generator hunt the counterexample. Doing this to my own published reducer found a rule I had promised in print and never actually enforced.
Effects Are Values: Functional Core, Imperative Shell
Your business rules can't be tested because they're welded to fetches, toasts, and analytics calls. Split the program in two: a pure core that decides what should happen and returns it as plain data, and a thin shell that performs it. The mock count drops to zero.