- Notifications
You must be signed in to change notification settings - Fork 153
Closed
Labels
Milestone
Description
Hello,
I have an async function that takes a query function as a parameter:
export const chooseElementFromSomewhere = async ( text: string, getAllByLabelText: (text: string | RegExp, options?: SelectorMatcherOptions) => HTMLElement[], ): Promise<void> => { const someElement = getAllByLabelText(text)[0].parentElement; ... await someOtherAsyncFunction(); };
(somewhere in my test code)
await chooseElementFromSomewhere('someTextToUseInAQuery', getAllByLabelText);
Calls to this function are triggering this eslint rule:
'getAllByLabelText' does not need 'await' operator testing-library/no-await-sync-query
I think it's a bug in the eslint parsing/interpreting rule. The expected behavior would be for eslint to pass my code as it is.