Skip to content

Conversation

@AtofStryker
Copy link
Contributor

@AtofStryker AtofStryker commented Nov 26, 2025

Additional details

Adds a zoneless component testing harness for Angular 20 (experimental) and Angular 21. Angular 21 ships with zoneless and Cypress will scaffold cypress/angular-zoneless for Angular 21+ projects.

Because this is likely going to be the next target for cypress/angular and the recommended pattern for data-binding is now signals, this testing harness will be remove autoDetectChanges as this happens naturally and autoSpyOutputs as @Output decorators are legacy and can be created manually via createSpyOutputs.

NOTE: when we merge the changes upstream in #33007 we need to call this out as BREAKING CHANGES

Additionally, with the addition of the zoneless mount handler, the angular-21 system test project needs it's own set of fixtures, which will eventually be moved into the main fixture directory (as a replacement) once Angular 18 and 19 support are officially dropped from Cypress.

After this releases, we need to update @cypress/schematic to support Angular 21 as the scaffolded files via the schematic CLI are not correct. I have a WIP of this on #33027 and it must be done AFTER this feature is released

Steps to test

How has the user experience changed?

PR Tasks


Note

Introduces @cypress/angular-zoneless for Angular 21 (and 20 preview) and integrates it across the CLI, CI pipelines, scaffolding wizard, and system tests (adds an Angular 21 project).

  • Angular Component Testing:
    • New Package: Adds @cypress/angular-zoneless with mount/createOutputSpy, zoneless TestBed via provideZonelessChangeDetection, and rollup/tsconfig.
    • Existing Angular Adapter: Subscribes signal outputs to avoid leaks; adds @angular/core/rxjs-interop to externals.
  • CLI:
    • Exposes cypress/angular-zoneless (exports, files, devDeps) and syncs in post-build; updates ESLint ignores; updates changelog.
  • Scaffolding/Wizard:
    • Auto-selects cypress/angular-zoneless for Angular >=21; support file generation tests accept both cypress/angular and cypress/angular-zoneless.
  • CI:
    • Adds npm-angular-zoneless build job to main and PR workflows; updates branch filters; bumps cache key.
  • System Tests:
    • Adds full angular-21 fixture using zoneless harness; updates configs/aliases, component-index, and specs; separates Angular 21 run; adjusts Angular handler test (styles.css); fixes provider key typo in an existing spec.
  • Schematics:
    • Updates tests to target Angular 19/20 fixtures.

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

@AtofStryker AtofStryker force-pushed the feat/add_zoneless_angular_harness branch from 5700a7b to b3a6a49 Compare November 26, 2025 17:54
@cypress
Copy link

cypress bot commented Nov 26, 2025

cypress    Run #67669

Run Properties:  status check passed Passed #67669  •  git commit 1e24ba1c56: make sure not to bundle rxjs interopt
Project cypress
Branch Review feat/add_zoneless_angular_harness
Run status status check passed Passed #67669
Run duration 19m 52s
Commit git commit 1e24ba1c56: make sure not to bundle rxjs interopt
Committer Bill Glesias
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 4
Tests that did not run due to a developer annotating a test with .skip  Pending 27
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 798
View all changes introduced in this branch ↗︎
UI Coverage  62.34%
  Untested elements 27  
  Tested elements 48  
Accessibility  99.02%
  Failed rules  0 critical   3 serious   1 moderate   0 minor
  Failed elements 19  

@AtofStryker AtofStryker force-pushed the feat/add_zoneless_angular_harness branch from 6b71efe to a1b2377 Compare November 26, 2025 20:36
…se zoneless support FIRST before we can have the schematic support angular 21
@AtofStryker AtofStryker force-pushed the feat/add_zoneless_angular_harness branch from a1b2377 to 15f446b Compare November 26, 2025 20:40
}).subscribe((value) => {
component[expectedChangeKey]?.emit(value)
})
activeInternalSubscriptions.push(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixing a bug here? don't think we need a changelog because nothing was reported but cursorbot did detect a possible memory leak here

const cypressSchematicPackagePath = path.join(__dirname, '..')

const ANGULAR_PROJECTS: ProjectFixtureDir[] = ['angular-20', 'angular-21']
const ANGULAR_PROJECTS: ProjectFixtureDir[] = ['angular-19', 'angular-20']
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we have to downgrade the test because the zoneless handler isn't supported within the binary yet (see the PR description)

"jsdom": "^27.1.0",
"typescript": "~5.9.2",
"vitest": "^4.0.8",
"zone.js": "~0.15.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

removes the zone.js dependency as promised

@AtofStryker AtofStryker force-pushed the feat/add_zoneless_angular_harness branch from 10e9b77 to 70ce43b Compare November 26, 2025 22:35
@AtofStryker AtofStryker linked an issue Dec 1, 2025 that may be closed by this pull request
@AtofStryker AtofStryker self-assigned this Dec 1, 2025
@AtofStryker AtofStryker force-pushed the feat/add_zoneless_angular_harness branch from 47d9a59 to 1e24ba1 Compare December 2, 2025 02:33
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.

Cypress component tests not working without zone.js

2 participants