Skip to content

fix: accept expect.soft.poll as a valid assertion - #524

Merged
mskelton merged 1 commit into
mskelton:mainfrom
JordyRdev:cursor/fix-expect-soft-poll-c367
Oct 29, 2026
Merged

mskelton merged 1 commit into
mskelton:mainfrom
JordyRdev:cursor/fix-expect-soft-poll-c367

Conversation

@JordyRdev

Copy link
Copy Markdown
Contributor

Summary

Playwright 1.61 supports soft polling assertions: await expect.soft.poll(() => value).toBe(expected).

valid-expect reported that chain as an unknown modifier, and expect-expect did not count it as an assertion. expect.soft.poll(...) is now a valid expect chain and counts as an assertion, including computed forms such as expect["soft"]["poll"](...). Chains Playwright does not support (expect.poll.soft and expect.soft(...).poll) stay invalid.

Fixes #519

Test plan

  • Parser, valid-expect, and expect-expect tests for expect.soft.poll
  • Coverage for other rules that parse expect chains (missing-playwright-await, no-useless-await, no-standalone-expect, prefer-ending-with-an-expect, max-expects, require-soft-assertions, no-conditional-expect, prefer-to-be, prefer-strict-equal, no-useless-not)
  • yarn test
  • yarn format:check && yarn lint && yarn typecheck

Playwright 1.61 supports soft polling assertions. Recognize
expect.soft.poll(...) as a valid expect chain and count it as an
assertion, while still rejecting unsupported orders such as
expect.poll.soft.

Fixes mskelton#519
@mskelton
mskelton enabled auto-merge (squash) October 29, 2026 01:31
@mskelton
mskelton merged commit d499b63 into mskelton:main Oct 29, 2026
1 check passed
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

Successfully merging this pull request may close these issues.

valid-expect: support expect.soft.poll (Playwright 1.61+)

2 participants