Skip to content

Conversation

@AtofStryker
Copy link
Contributor

@AtofStryker AtofStryker commented Nov 26, 2025

  • Closes

Additional details

Adds Angular 21 support and proper scaffolding to @cypress/schematic. This work cannot be finalized until Cypress 15.8.0 is released containing the zoneless changes

Steps to test

How has the user experience changed?

PR Tasks


Note

Adds Angular 21 support, switching CT scaffolding to cypress/angular-zoneless for >=21 and updating tests, templates, and dependencies accordingly.

  • Schematic:
    • Use semver to detect Angular version (getAngularSemverVersion) and select CT templates: ./files-ct-zoneless for >=21, otherwise ./files-ct.
    • Update deps: add semver; bump Angular devkit/CLI/schematics to v21; add debug note to CONTRIBUTING.
    • Temporarily hardcode Cypress binary URL in addPackageJsonDependency.
  • Templates (CT Zoneless):
    • Add files-ct-zoneless/component.ts.template using cypress/angular-zoneless mount.
    • Add files-ct-zoneless/component-index.html.template.
  • Tests:
    • Run against angular-20 and angular-21.
    • Conditionally copy cli/angular-zoneless and pass --standalone for Angular 21 component generation.
    • For Angular 21 e2e setup, require --component flag to configure support file.
  • System tests (Angular 21):
    • Add missing NgModule/WrapperModule, provider module, and adjust mount.cy.ts for zoneless usage.
    • Update tsconfig.app.json to include cypress types.

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

@cypress
Copy link

cypress bot commented Nov 26, 2025

cypress    Run #67746

Run Properties:  status check passed Passed #67746  •  git commit efbeea7109: WIP: support angular 21 inside cypress schematic
Project cypress
Branch Review chore/cypress-schematic-angular-21
Run status status check passed Passed #67746
Run duration 19m 37s
Commit git commit efbeea7109: WIP: support angular 21 inside cypress schematic
Committer Bill Glesias
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 10
Tests that did not run due to a developer annotating a test with .skip  Pending 1097
Tests that did not run due to a failure in a mocha hook  Skipped 4
Tests that passed  Passing 26703
View all changes introduced in this branch ↗︎

Warning

Partial Report: The results for the Application Quality reports may be incomplete.

UI Coverage  45.74%
  Untested elements 186  
  Tested elements 161  
Accessibility  98%
  Failed rules  4 critical   8 serious   2 moderate   2 minor
  Failed elements 101  

@AtofStryker AtofStryker self-assigned this Dec 3, 2025
@AtofStryker AtofStryker force-pushed the chore/cypress-schematic-angular-21 branch from b3e5b6a to 9a38f7c Compare December 3, 2025 22:57
if (overwrite || !json.get(path)) {
json.modify(path, version)
// mock the correct binary here for now
json.modify(path, 'https://cdn.cypress.io/beta/npm/15.8.0/darwin-arm64/feat/add_zoneless_angular_harness-d64f6cf48ca1d64475a53a44e83c2d58cc627dd9/cypress.tgz')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Hardcoded beta binary URL replaces actual Cypress version

The addPackageJsonDependency function ignores the version parameter passed from the caller and hardcodes a specific beta CDN URL instead. When users run ng add @cypress/schematic, this causes Cypress to be installed from a specific feature branch beta build rather than the latest stable version from npm. The version variable is destructured but never used, as indicated by the @ts-expect-error comment acknowledging this should be removed. This appears to be debug code that was accidentally committed.

Additional Locations (1)

Fix in Cursor Fix in Web

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is currently the only way to test the zoneless handler as it isn't published

const { projects } = angularJsonValue

// if using Angular 21 or greater, we need to use the cypress/angular-zoneless mount function
const applyPath = isSemverGte(options.__version__, '21.0.0') ? './files-ct-zoneless' : './files-ct'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Null version causes semver comparison to throw error

The isSemverGte(options.__version__, '21.0.0') call can throw a TypeError when options.__version__ is null. The getAngularSemverVersion function returns null when it can't parse the Angular version or when @angular/core isn't found in dependencies. The semver gte function throws when given null as the first argument rather than returning false. This would cause the schematic to crash for projects with unusual or missing Angular version specifications.

Fix in Cursor Fix in Web

@AtofStryker AtofStryker changed the base branch from develop to feat/add_zoneless_angular_harness December 4, 2025 15:00
@AtofStryker AtofStryker force-pushed the chore/cypress-schematic-angular-21 branch from 9a38f7c to efbeea7 Compare December 4, 2025 15:00
Base automatically changed from feat/add_zoneless_angular_harness to develop December 4, 2025 20:47
@AtofStryker AtofStryker force-pushed the chore/cypress-schematic-angular-21 branch from efbeea7 to 4ee10c4 Compare December 4, 2025 22:15
@AtofStryker AtofStryker marked this pull request as draft December 4, 2025 22:15
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.

2 participants