Commit b15f3af 1 parent 459cedf commit b15f3af Copy full SHA for b15f3af
File tree 4 files changed +7
-2
lines changed
4 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -167,7 +167,6 @@ installations requiring long-term consistency.
167
167
| [ no-focused-tests] ( docs/rules/no-focused-tests.md ) | Disallow focused tests | ![ recommended] [ ] | ![ suggest] [ ] |
168
168
| [ no-hooks] ( docs/rules/no-hooks.md ) | Disallow setup and teardown hooks | | |
169
169
| [ no-identical-title] ( docs/rules/no-identical-title.md ) | Disallow identical titles | ![ recommended] [ ] | |
170
- | [ no-if] ( docs/rules/no-if.md ) | Disallow conditional logic | | |
171
170
| [ no-interpolation-in-snapshots] ( docs/rules/no-interpolation-in-snapshots.md ) | Disallow string interpolation inside snapshots | ![ recommended] [ ] | |
172
171
| [ no-jasmine-globals] ( docs/rules/no-jasmine-globals.md ) | Disallow Jasmine globals | ![ recommended] [ ] | ![ fixable] [ ] |
173
172
| [ no-jest-import] ( docs/rules/no-jest-import.md ) | Disallow importing Jest | ![ recommended] [ ] | |
Original file line number Diff line number Diff line change 1
1
# Disallow conditional logic (` no-if ` )
2
2
3
+ ## Deprecated
4
+
5
+ This rule has been deprecated in favor of
6
+ [ ` no-conditional-in-test ` ] ( no-conditional-in-test.md ) .
7
+
3
8
Conditional logic in tests is usually an indication that a test is attempting to
4
9
cover too much, and not testing the logic it intends to. Each branch of code
5
10
executing 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 {
25
25
" jest/no-focused-tests" : " error" ,
26
26
" jest/no-hooks" : " error" ,
27
27
" jest/no-identical-title" : " error" ,
28
- " jest/no-if" : " error" ,
29
28
" jest/no-interpolation-in-snapshots" : " error" ,
30
29
" jest/no-jasmine-globals" : " error" ,
31
30
" jest/no-jest-import" : " error" ,
Original file line number Diff line number Diff line change @@ -44,6 +44,8 @@ export default createRule({
44
44
messages : {
45
45
conditionalInTest : 'Test should not contain {{ condition }} statements.' ,
46
46
} ,
47
+ deprecated : true ,
48
+ replacedBy : [ 'no-conditional-in-test' ] ,
47
49
schema : [ ] ,
48
50
type : 'suggestion' ,
49
51
} ,
You can’t perform that action at this time.
0 commit comments