Skip to content

Comments

fix: Code Smell at packages/driver/src/cypress/runner.ts#L529#33399

Open
bintocher wants to merge 2 commits intocypress-io:developfrom
bintocher:bintocher/issue-32064
Open

fix: Code Smell at packages/driver/src/cypress/runner.ts#L529#33399
bintocher wants to merge 2 commits intocypress-io:developfrom
bintocher:bintocher/issue-32064

Conversation

@bintocher
Copy link

Summary

Simplifies conditional logic by removing the redundant config('exit') check from shouldAlwaysResetPage and pause command conditions. The exit configuration does not affect page reset behavior in run mode, making the additional check unnecessary code smell.

Issue

Fixes #32064

Changes

  • Simplified shouldAlwaysResetPage calculation in runner.ts by removing the unused exit config check
  • Updated pause command condition in debugging.ts to match the simplified logic
  • Aligned test helper functions in test-isolation.spec.js and test-isolation-describe-config.spec.js with the production code changes

Testing

  • Verified the logic equivalence: the simplified condition isRunMode && !config('browser').isHeaded produces the same result as the original expression
  • Ensured test helper functions match the production implementation for consistency

The `--exit` flag was incorrectly factored into the headed browser
check for page reset behavior. This condition was unnecessary and
has been removed to simplify the logic.
Fixes cypress-io#32064
@cypress-app-bot
Copy link
Collaborator

@cacieprins cacieprins self-requested a review February 23, 2026 15:57
@cacieprins cacieprins self-assigned this Feb 23, 2026
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.

Code Smell at packages/driver/src/cypress/runner.ts#L529

3 participants