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.

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 a new zoneless Angular component testing harness and integrates it across CLI, CI, scaffolding, and system tests (including Angular 21).

  • Angular Component Testing:
    • New package: @cypress/angular-zoneless with mount API using provideZonelessChangeDetection, signal syncing, and cleanup.
    • Angular (zoned) tweak: ensure signal subscriptions are cleaned up when spying on model signals.
  • CLI/Packaging:
    • Export, bundle, and ship cypress/angular-zoneless (exports, files, post-build copy, ignores).
    • Docs/links: add @cypress/angular-zoneless to root CHANGELOG.md; CLI changelog notes zoneless support.
  • CI:
    • Add npm-angular-zoneless job and include in main and PR workflows; update branch filters; bump cache key.
  • Scaffolding & Tests:
    • Wizard selects cypress/angular-zoneless for Angular >=21; support file generation tests updated.
    • Add full system-tests/projects/angular-21 (zoneless setup, specs, config without zone.js) and include in system test matrix; adjust webpack-dev-server Angular 21 expectations.
    • Schematic tests retarget Angular fixtures (19/20).

Written by Cursor Bugbot for commit 70ce43b. 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 #67612

Run Properties:  status check failed Failed #67612  •  git commit 70ce43b063: fix duplicate key
Project cypress
Branch Review feat/add_zoneless_angular_harness
Run status status check failed Failed #67612
Run duration 22m 07s
Commit git commit 70ce43b063: fix duplicate key
Committer Bill Glesias
View all properties for this run ↗︎

Test results
Tests that failed  Failures 4
Tests that were flaky  Flaky 2
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 15
Tests that passed  Passing 779
View all changes introduced in this branch ↗︎
UI Coverage  62.34%
  Untested elements 27  
  Tested elements 48  
Accessibility  99.04%
  Failed rules  0 critical   3 serious   1 moderate   0 minor
  Failed elements 19  

Tests for review

Failed  cypress\e2e\runner\retries.experimentalRetries.mochaEvents.cy.ts • 1 failed test • app-e2e

View Output

Test Artifacts
... > does not try to serialize error with err.actual as DOM node Test Replay Screenshots
Failed  cypress\e2e\runner\runner.ui.cy.ts • 3 failed tests • app-e2e

View Output

Test Artifacts
src/cypress/runner > tests finish with correct state > no tests Test Replay Screenshots
src/cypress/runner > other specs > file with empty suites only displays no tests found Test Replay Screenshots
src/cypress/runner > reporter interaction > user can stop test execution Test Replay Screenshots
Flakiness  cypress\e2e\cypress-origin-communicator.cy.ts • 2 flaky tests • app-e2e

View Output

Test Artifacts
Cypress In Cypress Origin Communicator > primary origin memory leak prevention > cleans up the primaryOriginCommunicator events when navigating away from the /specs to /runs Test Replay Screenshots
Cypress In Cypress Origin Communicator > primary origin memory leak prevention > cleans up the primaryOriginCommunicator events when navigating to run a different spec Test Replay Screenshots

@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

},
}

cy.mount(ProductComponent, { providers: [{ provider: Cart, useValue: cartFake }] })
Copy link

Choose a reason for hiding this comment

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

Bug: Test uses wrong property name for Angular DI

The test "should verify a faked service" uses provider: Cart instead of the correct Angular DI property provide: Cart. Angular's dependency injection requires provide as the property key - using provider causes Angular to ignore the configuration entirely. The test still passes because both the fake and real Cart implementations have identical behavior, but this test doesn't actually verify provider overrides work as intended.

Fix in Cursor Fix in Web

@AtofStryker AtofStryker force-pushed the feat/add_zoneless_angular_harness branch from 10e9b77 to 70ce43b Compare November 26, 2025 22:35
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