diff --git a/rules/__tests__/no-focused-tests.test.js b/rules/__tests__/no-focused-tests.test.js index eccc922fb..4690f7d0c 100644 --- a/rules/__tests__/no-focused-tests.test.js +++ b/rules/__tests__/no-focused-tests.test.js @@ -63,5 +63,9 @@ ruleTester.run('no-focused-tests', rule, { code: 'fit()', errors: [{ message: expectedErrorMessage, column: 1, line: 1 }], }, + { + code: 'fit.each()', + errors: [{ message: expectedErrorMessage, column: 1, line: 1 }], + }, ], }); diff --git a/rules/no-focused-tests.js b/rules/no-focused-tests.js index 38e496e3f..d815ce8bb 100644 --- a/rules/no-focused-tests.js +++ b/rules/no-focused-tests.js @@ -30,6 +30,17 @@ module.exports = { const callee = node.callee; if (callee.type === 'MemberExpression') { + if ( + callee.object.type === 'Identifier' && + isCallToFocusedTestFunction(callee.object) + ) { + context.report({ + message: 'Unexpected focused test.', + node: callee.object, + }); + return; + } + if ( callee.object.type === 'MemberExpression' && isCallToTestOnlyFunction(callee.object)