Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[expect-expect] Allow assertFunctionNames to take regular expressions #352

Closed
zach-white-WT opened this issue Feb 4, 2025 · 0 comments
Closed

Comments

@zach-white-WT
Copy link

Our playwright project uses some pretty heavy page object model, which means in the test bodies, most of the expect() calls are within methods like pageObject.assertUIVisibility().
For now, we have the expect-expect rule turned off in the eslintrc.json file, but ideally we can re-enable this rule by taking advantage of the assertFunctionNames config.

Instead of needing to add every single assertion function to this list, would it be possible to allow regular expressions into this config? Something like:

{
  "playwright/expect-expect": [
    "error",
    {
      "assertFunctionNames": ["assert*", "validate*", "verify*"]
    }
  ]
}

Related issues in jest:
jest-community/eslint-plugin-jest#1103

@mskelton mskelton closed this as completed Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants