Skip to content

Rule suggestion - warn when custom error message is missing in expect function #51

Closed
@MindaugasMateika

Description

@MindaugasMateika

What do you think about the rule which should warn about missing custom error messages? I'm not very familiar with rule creation and what rules are ok/not ok so just putting it as a suggestion now.

Docs: https://playwright.dev/docs/test-assertions#custom-expect-message

+ Good
await expect(page.locator('text=Name'), 'should be logged in').toBeVisible()
- Bad
await expect(page.locator('text=Name')).toBeVisible()
+ Good
await expect.soft(page.locator('text=Name'), 'should be logged in').toBeVisible()
- Bad
await expect.soft(page.locator('text=Name')).toBeVisible()

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions