Commit 6d07cad 1 parent aba53e4 commit 6d07cad Copy full SHA for 6d07cad
File tree 3 files changed +9
-1
lines changed
3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -152,7 +152,6 @@ installations requiring long-term consistency.
152
152
| [ no-test-callback] ( docs/rules/no-test-callback.md ) | Avoid using a callback in asynchronous tests | ![ recommended] [ ] | ![ suggest] [ ] |
153
153
| [ no-test-prefixes] ( docs/rules/no-test-prefixes.md ) | Use ` .only ` and ` .skip ` over ` f ` and ` x ` | ![ recommended] [ ] | ![ fixable] [ ] |
154
154
| [ no-test-return-statement] ( docs/rules/no-test-return-statement.md ) | Disallow explicitly returning from tests | | |
155
- | [ no-try-expect] ( docs/rules/no-try-expect.md ) | Prefer using toThrow for exception tests | ![ recommended] [ ] | |
156
155
| [ prefer-called-with] ( docs/rules/prefer-called-with.md ) | Suggest using ` toBeCalledWith() ` OR ` toHaveBeenCalledWith() ` | | |
157
156
| [ prefer-expect-assertions] ( docs/rules/prefer-expect-assertions.md ) | Suggest using ` expect.assertions() ` OR ` expect.hasAssertions() ` | | ![ suggest] [ ] |
158
157
| [ prefer-hooks-on-top] ( docs/rules/prefer-hooks-on-top.md ) | Suggest to have all hooks at top level | | |
Original file line number Diff line number Diff line change 1
1
# Prevent catch assertions in tests (` no-try-expect ` )
2
2
3
+ ## Deprecated
4
+
5
+ This rule has been deprecated in favor of
6
+ [ ` no-conditional-expect ` ] ( no-conditional-expect.md ) .
7
+
8
+ ---
9
+
3
10
This rule prevents the use of ` expect ` inside ` catch ` blocks.
4
11
5
12
## Rule Details
Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ export default createRule({
14
14
category : 'Best Practices' ,
15
15
recommended : false ,
16
16
} ,
17
+ deprecated : true ,
18
+ replacedBy : [ 'no-conditional-expect' ] ,
17
19
messages : {
18
20
noTryExpect : [
19
21
'Tests should use Jest‘s exception helpers.' ,
You can’t perform that action at this time.
0 commit comments