Skip to content

valid-describe-callback reports false positive with named function #339

Open
@msorens

Description

@msorens

I have a function that runs a block of tests and I use this function in a couple places, so I have it encapsulated as a first-class function rather than inlined, as is typical. The function is a valid callback meeting the criteria specified by the rule:

  • should not be async
  • should not contain any parameters
  • should not contain any return statements

Minimal test case:

function foo() {
  test('create policies', async ({ system, page }) => {})
}
test.describe('policies', foo)

The describe line is flagged as a violation because the function is not inlined. Would be nice if the plugin could recognize this case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions