general.md•752 B
- The first line of every test file should be a comment containing an apple emoji: `# 🍎`
- Code is transient. Tests are forever. Write tests for the LLM after you, the one that will be rewriting the application in 6 months and porting it to a new technology.
- Before testing a protected method, ask "Can this logic be adequately tested through the public interface?". If yes, don't test the protected method directly. If no, continue testing the protected method.
- Arrange, Act, Assert is a good pattern.
- Vague test names using words like "correct", "properly", or "should work" make it difficult to understand what broke when tests fail and should therefore be avoided.
- Do not test things like "if I mock X to return Y, X should return Y".