-
Notifications
You must be signed in to change notification settings - Fork 112
feat!: @cypress/code-coverage configuration must now be placed under expose instead of env in your Cypress configuration. #977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…installed?" This reverts commit 6dea903.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
BREAKING CHANGE: @cypress/code-coverage configuration must now be placed under expose instead of env in your Cypress configuration.
Migrate from Cypress.env() to Cypress.expose()
This PR migrates @cypress/code-coverage's configuration from Cypress.env() to Cypress.expose() in response to the deprecation of Cypress.env() in Cypress v15.10.0. Cypress.env() will be removed in Cypress 16, necessitating this breaking change. For more details about why Cypress has deprecated Cypress.env(), see the official documentation on migrating from Cypress.env() to Cypress.expose().
What Changed
Configuration location: This plugin is now configured via the expose key in your Cypress configuration, rather than the env key.
API access: All internal references to Cypress.env() replaced with Cypress.expose()
Migration
Before:
After:
CLI usage:
Before
After
Additional Changes
TypeScript migration: Codebase migrated from JavaScript to TypeScript (see #975)
Test infrastructure: Unit tests migrated from Cypress e2e tests to Vitest (see #974)
Documentation: Updated README with migration guide and all configuration examples
Test apps: All test applications updated to use new configuration format
Dependencies: Updated to require Cypress >=15.10.0 and Node >=20
Impact
Breaking: Existing configurations using env.codeCoverage will no longer work
Compatibility: Requires Cypress >=15.10.0. Requires Node >=20.
Migration path: Clear migration guide provided in README
See the migration guide in the README for detailed migration instructions.
Note
High Risk
Breaking change to how users configure and how the plugin reads runtime configuration, plus significant refactors in support/task code and CI that could impact coverage collection/reporting if any expose/env assumptions are missed.
Overview
BREAKING: Migrates
@cypress/code-coverageconfiguration fromenv/Cypress.env()toexpose/Cypress.expose()(including CLI usage via--expose), and updates docs/examples accordingly with a new 3.x→4.x migration section.Refactors the plugin implementation to TypeScript/ESM-style imports and updates the runtime hooks/tasks to read config and flags from
expose(e.g.,codeCoverage,sendCoverageBatchSize,coverage, and task-registration flag). Adds new distributable entrypoints (lib/plugins.ts,lib/use-babelrc.ts) and converts middleware (express,hapi,nextjs) to typed TS while preserving the__coverage__endpoint behavior.CI is modernized to Node 22/Cypress orb v6, introduces a
build-distworkspace step, restructures test-app verification into a matrix job (plus Windows build+test changes), and ignores per-test-apppackage-lock.jsonfiles.Written by Cursor Bugbot for commit 2455c9b. This will update automatically on new commits. Configure here.