no-conditional-in-test
Added in v0.8.2Configuration
rslint.config.ts
Rule Details
Disallows conditional control flow in test bodies. Separate tests make each expected behavior and failure easier to identify.
Reported forms are if and switch statements, conditional expressions, and the logical operators &&, ||, and ??. Optional chaining is reported as well once allowOptionalChaining is turned off.
The rule checks test callbacks and functions declared inside them. Conditions used for suite setup or helpers declared outside a test are not reported.