Mocks must return the real shapes
A blanket “mock it everywhere” fix can quietly replace the test doubles that make tests meaningful. Then the suite turns green, or red, for the wrong reason. A mock has to match the real module's exports and return shapes, not just exist.
Read the lesson →Fix the SQL dialect bug in every dialect
When one SQL dialect breaks on user input, check every dialect that builds the same string by hand: the bug is in the shared pattern, not the one driver someone tested.
Read the lesson →Test the worst input a limit still allows
When you add a limit to stop malicious input, test the worst input the limit still allows, not only the one it now rejects.
Read the lesson →Negative tests must create what they exclude
A negative test (“X is never included”) has to create X first. Otherwise it passes because X doesn't exist, and it proves nothing about the guard it is named after.
Read the lesson →