Skip to content
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

feat: handle getStylesConfig returning a Promise in Angular 16 #26559

Conversation

leosvelperez
Copy link
Contributor

@leosvelperez leosvelperez commented Apr 21, 2023

  • Closes

Additional details

In the upcoming Angular 16, the getStylesConfig function returns a Promise (angular/angular-cli@758b069#diff-b14bb6b4458b0b51ba8711c389cf6c73b0837d0cc8e09df93899d2db888e6ad6R37). The Angular handler uses that function and it doesn't expect it to return a Promise. Therefore, it fails with Angular 16.

The solution just wraps the call to getStylesConfig to always handle a Promise regardless of the Angular version. That way we keep compatibility with older versions and support the new version.

Steps to test

I wasn't sure if we wanted to add a fixture with Angular 16 RC version. I can do that if needed. The tests for the existing versions should still pass and would cover that this change doesn't break the compatibility with older versions.

How has the user experience changed?

PR Tasks

@CLAassistant
Copy link

CLAassistant commented Apr 21, 2023

CLA assistant check
All committers have signed the CLA.

@leosvelperez leosvelperez marked this pull request as ready for review April 21, 2023 10:50
@jordanpowell88 jordanpowell88 self-assigned this Apr 21, 2023
@cypress
Copy link

cypress bot commented Apr 21, 2023

26 flaky tests on run #45722 ↗︎

0 27264 1307 0 Flakiness 26

Details:

feat: handle getStylesConfig returning a Promise in Angular 16
Project: cypress Commit: 8c196e0fc7
Status: Passed Duration: 19:28 💡
Started: Apr 21, 2023 11:00 AM Ended: Apr 21, 2023 11:20 AM
Flakiness  commands/net_stubbing.cy.ts • 1 flaky test • 5x-driver-firefox

View Output Video

Test Artifacts
network stubbing > intercepting request > can delay and throttle a StaticResponse Output
Flakiness  create-from-component.cy.ts • 1 flaky test • app-e2e

View Output Video

Test Artifacts
... > runs generated spec Output Screenshots Video
Flakiness  specs_list_latest_runs.cy.ts • 1 flaky test • app-e2e

View Output Video

Test Artifacts
App/Cloud Integration - Latest runs and Average duration > when no runs are recorded > shows placeholders for all visible specs Output Screenshots Video
Flakiness  cypress/cypress.cy.js • 3 flaky tests • 5x-driver-firefox

View Output Video

Test Artifacts
... > correctly returns currentRetry Output
... > correctly returns currentRetry Output
... > correctly returns currentRetry Output
Flakiness  cypress-origin-communicator.cy.ts • 1 flaky test • app-e2e

View Output Video

Test Artifacts
Cypress In Cypress Origin Communicator > cy.origin passivity with app interactions > passes upon test reload mid test execution Output Screenshots Video

The first 5 flaky specs are shown, see all 15 specs in Cypress Cloud.

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

@jordanpowell88 jordanpowell88 changed the base branch from develop to jordanpowell88/angular-16-support April 21, 2023 12:13
@jordanpowell88 jordanpowell88 force-pushed the jordanpowell88/angular-16-support branch from baaf717 to 598e429 Compare April 21, 2023 12:17
Copy link
Collaborator

@jordanpowell88 jordanpowell88 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @leosvelperez !

@jordanpowell88 jordanpowell88 merged commit 5381c1b into cypress-io:jordanpowell88/angular-16-support Apr 21, 2023
@leosvelperez leosvelperez deleted the feat/angular-16-webpack-styles-config branch April 21, 2023 13:01
jordanpowell88 added a commit that referenced this pull request Apr 24, 2023
* feat(angular): add support for Angular 16

* chore: update angular 16 pre-release version

* feat: handle getStylesConfig returning a Promise in Angular 16 (#26559)

* chore: remove next from deps to prepare for release

* remove .only, add angular-16 to webpack-dev-server e2e tests

---------

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
Co-authored-by: astone123 <adams@cypress.io>
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.

None yet

3 participants