## Lesson — Avoid using partial matchers like toContain when testing

**Tags:** testing, security, jest

Avoid using partial matchers like `toContain` when testing secret masking or data sanitization. Exact string assertions are necessary to ensure the logic preserves surrounding context and does not redact more information than intended.
