Skip to content

[no-standalone-expect]: false positive for expect.any in __mocks__ file #1189

Closed

Description

I have a file in __mocks__ called twitch-js-api.js and I'm using the following:

const formatStreams = jest.fn().mockReturnValue([
  {
    channel: {
      logo: expect.any(String)
    }
  }
])

Yet this rule now warns on expect.any(String)? Isn't expect allowed in mock files? This code has worked for years.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions