Commit 914b24a 1 parent 918873b commit 914b24a Copy full SHA for 914b24a
File tree 4 files changed +6
-2
lines changed
4 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -203,7 +203,7 @@ installations requiring long-term consistency.
203
203
| [ expect-expect] ( docs/rules/expect-expect.md ) | Enforce assertion to be made in a test body | ![ recommended] [ ] | |
204
204
| [ max-expects] ( docs/rules/max-expects.md ) | Enforces a maximum number assertion calls in a test body | | |
205
205
| [ max-nested-describe] ( docs/rules/max-nested-describe.md ) | Enforces a maximum depth to nested describe calls | | |
206
- | [ no-alias-methods] ( docs/rules/no-alias-methods.md ) | Disallow alias methods | ![ style ] [ ] | ![ fixable] [ ] |
206
+ | [ no-alias-methods] ( docs/rules/no-alias-methods.md ) | Disallow alias methods | ![ recommended ] [ ] | ![ fixable] [ ] |
207
207
| [ no-commented-out-tests] ( docs/rules/no-commented-out-tests.md ) | Disallow commented out tests | ![ recommended] [ ] | |
208
208
| [ no-conditional-expect] ( docs/rules/no-conditional-expect.md ) | Prevent calling ` expect ` conditionally | ![ recommended] [ ] | |
209
209
| [ no-conditional-in-test] ( docs/rules/no-conditional-in-test.md ) | Disallow conditional logic in tests | | |
Original file line number Diff line number Diff line change 1
1
# Disallow alias methods (` no-alias-methods ` )
2
2
3
+ > These aliases are going to be removed in the next major version of Jest - see
4
+ > https://github.com/facebook/jest/issues/13164 for more
5
+
3
6
Several Jest methods have alias names, such as ` toThrow ` having the alias of
4
7
` toThrowError ` . This rule ensures that only the canonical name as used in the
5
8
Jest documentation is used in the code. This makes it easier to search for all
Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ exports[`rules should export configs that refer to actual rules 1`] = `
69
69
],
70
70
" rules" : {
71
71
" jest/expect-expect" : " warn" ,
72
+ " jest/no-alias-methods" : " error" ,
72
73
" jest/no-commented-out-tests" : " warn" ,
73
74
" jest/no-conditional-expect" : " error" ,
74
75
" jest/no-deprecated-functions" : " error" ,
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ export default createRule({
11
11
docs : {
12
12
category : 'Best Practices' ,
13
13
description : 'Disallow alias methods' ,
14
- recommended : false ,
14
+ recommended : 'error' ,
15
15
} ,
16
16
messages : {
17
17
replaceAlias : `Replace {{ alias }}() with its canonical name of {{ canonical }}()` ,
You can’t perform that action at this time.
0 commit comments