Skip to content

Commit

Permalink
chore(valid-expect): swap early return for smaller body
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath committed Aug 6, 2019
1 parent decfabb commit 405b2e8
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/rules/valid-expect.ts
Expand Up @@ -281,16 +281,11 @@ export default createRule<[{ alwaysAwait?: boolean }], MessageIds>({
// nothing called on "expect()"
'CallExpression:exit'(node: TSESTree.CallExpression) {
if (
!isExpectCall(node) ||
node.parent.type !== AST_NODE_TYPES.ExpressionStatement
isExpectCall(node) &&
node.parent.type === AST_NODE_TYPES.ExpressionStatement
) {
return;
context.report({ messageId: 'noAssertions', node });
}

context.report({
messageId: 'noAssertions',
node,
});
},
};
},
Expand Down

0 comments on commit 405b2e8

Please sign in to comment.