Skip to content

Commit 776c593

Browse files
committed
refactor: merge conditions
1 parent a79f402 commit 776c593

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/rules/prefer-expect-assertions.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -227,13 +227,15 @@ export default createRule<[RuleOptions], MessageIds>({
227227
return;
228228
}
229229

230-
if (jestFnCall?.type === 'expect' && inEachHook) {
231-
if (getAccessorValue(jestFnCall.members[0]) === 'hasAssertions') {
232-
checkExpectHasAssertions(jestFnCall, node);
230+
if (
231+
jestFnCall?.type === 'expect' &&
232+
inEachHook &&
233+
getAccessorValue(jestFnCall.members[0]) === 'hasAssertions'
234+
) {
235+
checkExpectHasAssertions(jestFnCall, node);
233236

234-
if (coveredByHookAtDepth < 0) {
235-
coveredByHookAtDepth = describeDepth;
236-
}
237+
if (coveredByHookAtDepth < 0) {
238+
coveredByHookAtDepth = describeDepth;
237239
}
238240
}
239241

0 commit comments

Comments
 (0)