Skip to content

no-standalone-expect false negative #355

Open
@MathiasWP

Description

@MathiasWP

If you import the "test" method and rename it to something else then this lint rule will throw an error.

Reproduction:

import { expect, test as setup } from "@playwright/test";

setup("set local state", async ({ page }) => {
  await expect(page.getByText("We use cookies")).toBeVisible(); // "Expect must be inside of a test block" is thrown 
  await page.getByTestId("cookie-settings").click();
})

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