Skip to content

Conversation

@mskelton
Copy link
Owner

@mskelton mskelton commented Nov 29, 2025

Fixes #400


Note

Permits expect inside Playwright fixture definitions by tracking .extend calls as a new fixture context and adds corresponding tests.

  • Rule (src/rules/no-standalone-expect.ts):
    • Add fixture block type; treat .extend member calls as fixture context using isPropertyAccessor.
    • Allow expect within fixture blocks; keep existing restrictions elsewhere.
    • Import and use isPropertyAccessor; update call stack enter/exit logic for .extend.
  • Tests (src/rules/no-standalone-expect.test.ts):
    • Add valid cases allowing expect in fixture definitions (base.extend, test.extend) and a case without await.

Written by Cursor Bugbot for commit 0b0a96f. This will update automatically on new commits. Configure here.

@mskelton mskelton merged commit b434289 into main Nov 29, 2025
4 checks passed
@mskelton mskelton deleted the fix_standalone_expect_in_fixture branch November 29, 2025 23:18
@github-actions
Copy link

🎉 This PR is included in version 2.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

no-standalone-expect not behaving correctly inside fixture

2 participants