465 B
465 B
Testing and Code Quality Rules
- No non-null assertions: Non-null assertions (the
!
operator) are a hack for missing null checks or extraneous null types. Always use proper null checks and handle possible null/undefined values explicitly. - Do not throw errors within tests: Use proper test assertions (e.g.,
expect(value).not.toBeNull()
) instead of throwing errors from within tests. This ensures test failures are reported clearly and consistently.