diff --git a/lib/rules/await-async-query.ts b/lib/rules/await-async-query.ts index 0af105a5..b665dc5f 100644 --- a/lib/rules/await-async-query.ts +++ b/lib/rules/await-async-query.ts @@ -52,7 +52,7 @@ export default createTestingLibraryRule({ CallExpression(node) { const identifierNode = getDeepestIdentifierNode(node); - if (!identifierNode) { + if (!identifierNode || identifierNode.name.endsWith('ByType')) { return; } diff --git a/tests/lib/rules/await-async-query.test.ts b/tests/lib/rules/await-async-query.test.ts index 8054035a..6b2314f3 100644 --- a/tests/lib/rules/await-async-query.test.ts +++ b/tests/lib/rules/await-async-query.test.ts @@ -330,6 +330,11 @@ ruleTester.run(RULE_NAME, rule, { // valid async query usage without any function defined // so there is no innermost function scope found `const element = await findByRole('button')`, + + // edge case for files using + // findByType or findAllByType + // from react-test-renderer + `const example = findByType('div')`, ], invalid: [