File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -167,7 +167,6 @@ installations requiring long-term consistency.
167167| [ no-focused-tests] ( docs/rules/no-focused-tests.md ) | Disallow focused tests | ![ recommended] [ ] | ![ suggest] [ ] |
168168| [ no-hooks] ( docs/rules/no-hooks.md ) | Disallow setup and teardown hooks | | |
169169| [ no-identical-title] ( docs/rules/no-identical-title.md ) | Disallow identical titles | ![ recommended] [ ] | |
170- | [ no-if] ( docs/rules/no-if.md ) | Disallow conditional logic | | |
171170| [ no-interpolation-in-snapshots] ( docs/rules/no-interpolation-in-snapshots.md ) | Disallow string interpolation inside snapshots | ![ recommended] [ ] | |
172171| [ no-jasmine-globals] ( docs/rules/no-jasmine-globals.md ) | Disallow Jasmine globals | ![ recommended] [ ] | ![ fixable] [ ] |
173172| [ no-jest-import] ( docs/rules/no-jest-import.md ) | Disallow importing Jest | ![ recommended] [ ] | |
Original file line number Diff line number Diff line change 11# Disallow conditional logic (` no-if ` )
22
3+ ## Deprecated
4+
5+ This rule has been deprecated in favor of
6+ [ ` no-conditional-in-test ` ] ( no-conditional-in-test.md ) .
7+
38Conditional logic in tests is usually an indication that a test is attempting to
49cover too much, and not testing the logic it intends to. Each branch of code
510executing within an if statement will usually be better served by a test devoted
Original file line number Diff line number Diff line change @@ -25,7 +25,6 @@ Object {
2525 " jest/no-focused-tests" : " error" ,
2626 " jest/no-hooks" : " error" ,
2727 " jest/no-identical-title" : " error" ,
28- " jest/no-if" : " error" ,
2928 " jest/no-interpolation-in-snapshots" : " error" ,
3029 " jest/no-jasmine-globals" : " error" ,
3130 " jest/no-jest-import" : " error" ,
Original file line number Diff line number Diff line change @@ -44,6 +44,8 @@ export default createRule({
4444 messages : {
4545 conditionalInTest : 'Test should not contain {{ condition }} statements.' ,
4646 } ,
47+ deprecated : true ,
48+ replacedBy : [ 'no-conditional-in-test' ] ,
4749 schema : [ ] ,
4850 type : 'suggestion' ,
4951 } ,
You can’t perform that action at this time.
0 commit comments