docs(claude): add rule T008 for custom matcher usage in tests#316
docs(claude): add rule T008 for custom matcher usage in tests#316
T008 for custom matcher usage in tests#316Conversation
Repeated corrections during #255 PR5 review showed that manual Result unwrapping and missing toStrictEqual in callbacks were a recurring pattern. Codifying as a rule prevents future sessions from repeating these mistakes. Benefits: - Documents all 6 available custom matchers in one place - Enforces toStrictEqual on full value object inside toBeOkWith callbacks - Bad/good examples make the expected pattern unambiguous
WalkthroughA new rule T008 is added to CLAUDE.md providing guidance on using custom matchers for Result and error assertions. The rule includes preferred matcher recommendations, disallowed patterns, available matchers, and examples demonstrating both error and success assertion paths. Changes
Estimated Code Review Effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Repeated corrections during #255 PR5 review showed that manual Result unwrapping and missing toStrictEqual in callbacks were a recurring pattern. Codifying as a rule prevents future sessions from repeating these mistakes.
Benefits:
Summary by CodeRabbit