Skip to content

await-async-utils flags un-called function references #1060

@puglyfe

Description

@puglyfe

Have you read the Troubleshooting section?

Yes

Plugin version

7.6.1

ESLint version

8.57.0

Node.js version

20.11

Bug description

I maintain an internal library that wraps testing-library with some additional options and bits of functionality. Part of our test suite asserts that we're exporting everything we think we are and includes one test case that's essentially equivalent to expect(waitFor).toBeDefined(). This gets flagged as an unhandled promise.

Steps to reproduce

Add this to the await-async-utils test suite:

...ASYNC_UTILS.map((asyncUtil) => ({
  code: `
    import { ${asyncUtil} } from '${testingFramework}';
    test('${asyncUtil} util not called is valid', () => {
      expect(${asyncUtil}).toBeDefined();
    });
  `,
})),

Error output/screenshots

No response

ESLint configuration

n/a

Rule(s) affected

await-async-utils only. await-async-events explicitly tests against this pattern, and await-async-queries supports it as well (though it isn't explicitly tested against).

Anything else?

No response

Do you want to submit a pull request to fix this bug?

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriagePending to be triaged by a maintainer

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions