Skip to content

feat: migrate plugin options from Cypress.env() to Cypress.expose() for Cypress 16#376

Merged
FRSgit merged 4 commits into
mainfrom
feat/cypress-16-expose-migration
Jul 2, 2026
Merged

feat: migrate plugin options from Cypress.env() to Cypress.expose() for Cypress 16#376
FRSgit merged 4 commits into
mainfrom
feat/cypress-16-expose-migration

Conversation

@FRSgit

@FRSgit FRSgit commented Jul 2, 2026

Copy link
Copy Markdown
Member

Closes #375

Summary

  • Adds src/version.utils.ts with supportsExpose(version) and getPluginConfig(config, key) helpers that branch on Cypress ≥ 15.10.0
  • Updates commands.ts to call Cypress.expose() on Cypress ≥ 15.10, falling back to Cypress.env() on older versions
  • Updates plugins.ts and task.hook.ts to read from config.expose on Cypress ≥ 15.10, falling back to config.env
  • Updates README examples to show --expose (Cypress 15.10+) alongside the legacy --env flag
  • Adds MIGRATION.md with a full migration guide for users

Behavior

Cypress version Config source
≥ 15.10.0 Cypress.expose() / config.expose
< 15.10.0 Cypress.env() / config.env (legacy)

No changes required inside tests — only how options are supplied changes (see MIGRATION.md).

Test plan

  • All existing unit tests pass (vitest run — 27/27)
  • New test cases added for the Cypress 15.10+ expose path in plugins.test.ts and task.hook.test.ts
  • TypeScript compiles without errors

🤖 Generated with Claude Code

FRSgit and others added 3 commits July 2, 2026 10:56
…or Cypress 16 compatibility

Cypress 16 removes Cypress.env() in favor of the synchronous Cypress.expose() API
(available since 15.10.0). The plugin now detects the Cypress version at runtime and
uses Cypress.expose()/config.expose for >=15.10.0 and falls back to the legacy
Cypress.env()/config.env for older versions.

Closes #375

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@FRSgit FRSgit force-pushed the feat/cypress-16-expose-migration branch from 604e910 to 1fc04b8 Compare July 2, 2026 12:13
@FRSgit FRSgit force-pushed the feat/cypress-16-expose-migration branch from 59f9dbf to d7dd930 Compare July 2, 2026 14:20
@FRSgit FRSgit merged commit 2b71557 into main Jul 2, 2026
6 checks passed
@FRSgit FRSgit deleted the feat/cypress-16-expose-migration branch July 2, 2026 14:40
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.

Migrate pluginVisualRegression* options from Cypress.env() to Cypress.expose()

1 participant