Skip to content

Commit 40cd89d

Browse files
G-RathSimenB
authored andcommitted
feat: add no-conditional-expect to the recommended ruleset
BREAKING CHANGE: recommend `no-conditional-expect` rule
1 parent 3705dff commit 40cd89d

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ installations requiring long-term consistency.
135135
| [lowercase-name](docs/rules/lowercase-name.md) | Enforce lowercase test names | | ![fixable][] |
136136
| [no-alias-methods](docs/rules/no-alias-methods.md) | Disallow alias methods | ![style][] | ![fixable][] |
137137
| [no-commented-out-tests](docs/rules/no-commented-out-tests.md) | Disallow commented out tests | ![recommended][] | |
138-
| [no-conditional-expect](docs/rules/no-conditional-expect.md) | Prevent calling `expect` conditionally | | |
138+
| [no-conditional-expect](docs/rules/no-conditional-expect.md) | Prevent calling `expect` conditionally | ![recommended][] | |
139139
| [no-deprecated-functions](docs/rules/no-deprecated-functions.md) | Disallow use of deprecated functions | ![recommended][] | ![fixable][] |
140140
| [no-disabled-tests](docs/rules/no-disabled-tests.md) | Disallow disabled tests | ![recommended][] | |
141141
| [no-duplicate-hooks](docs/rules/no-duplicate-hooks.md) | Disallow duplicate setup and teardown hooks | | |

src/__tests__/__snapshots__/rules.test.ts.snap

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ Object {
6666
"rules": Object {
6767
"jest/expect-expect": "warn",
6868
"jest/no-commented-out-tests": "warn",
69+
"jest/no-conditional-expect": "error",
6970
"jest/no-deprecated-functions": "error",
7071
"jest/no-disabled-tests": "warn",
7172
"jest/no-export": "error",

src/rules/no-conditional-expect.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default createRule({
1212
docs: {
1313
description: 'Prevent calling `expect` conditionally',
1414
category: 'Best Practices',
15-
recommended: false,
15+
recommended: 'error',
1616
},
1717
messages: {
1818
conditionalExpect: 'Avoid calling `expect` conditionally`',

0 commit comments

Comments
 (0)