cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
46.74k stars 3.16k forks source link

Angular 15 polyfills API change causes component testing to fail #24062

Closed Coly010 closed 1 year ago

Coly010 commented 1 year ago

Current behavior

Component testing will fail with Angular 15 workspaces due to a change in Angular's build and test options API for polyfills, which has changed from string to Polyfills which is a type alias for string[] | string.

The current error is:

Your configFile threw an error from: cypress.config.ts

We stopped running your tests because your config file crashed.

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received an instance of Array

You can see this in our Nx Cloud run for Angular 15 support branch: https://staging.nx.app/runs/2PyEc1jfqo6/task/e2e-angular-extensions:e2e

If you do a Find in Page and search for "fail" you'll see the error output.

Desired behavior

Component testing should work correctly for Angular 15 workspaces.

Test code to reproduce

Create an "Angular 15"* Workspace.

npx @angular/cli@next new myapp

Add component testing.

Try to run component tests.

  • Angular 15 is still in development so it's only next releases currently.

Cypress Version

latest

Node version

v16

Operating System

All

Debug Logs

No response

Other

No response

ZachJW34 commented 1 year ago

@Coly010 are you interested in contributing a fix?

Coly010 commented 1 year ago

Yes!

astone123 commented 1 year ago

Closed with #24064