-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Allow Angular CT configuration to accept custom project configurations #23161
Comments
Hi guys, were are using nx and we are having problems configuring component testing (angular). |
Hi @ZachJW34
It seems you're assuming the tsconfig.json is sitting around in the root directory. However, in my project, the path is
A workaround I'm currently using is having a "forwarding tsconfig.json" in my root folder extending from Best Regards, |
@ruimonteiro88 we are prioritizing this issue so we should be getting around to it this week or the next @NicBright we should be able to extend the provided tsconfig (which would eliminate the need to assume where it is). I think we decided on the root due to not wanting to include certain files in the compilation but we could override the |
The code for this is done in cypress-io/cypress#23494, but has yet to be released. |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
What would you like?
Angular CT setup should support custom build options to accommodate projects that don't follow the Angular CLI conventions.
Why is this needed?
To support projects that use Angular but don't adhere to Angular CLI conventions (particularly apps created with @nrwl/nx)
Other
We developed Angular CT for projects utilizing
@angular/cli
. There are conventions with Angular CLI created projects that we rely on, such as sourcing a project's build options via theirangular.json
. Nx is a popular monorepo tooling solution that supports Angular projects but don't follow the same conventions. The build options are the same, but their source can differ (configurations can be stored inworkspace.json
or project levelproject.json
configuration files).We can extend support by allowing these build options to be passed in explicitly (in the
cypress.config.ts
). Support could look like:We will probably have to normalize what the projectConfig contains. For Angular CLI projects, the type we expect is:
We need the
root
,sourceRoot
,options
andconfiguration['<key>']
information, but the json for Nx'sworkspace.json/project.json
might differ so we can condense it to:where we assume the
buildOptions
conform to the Angular builder schema. Rough outline but should fit the bill.We also assume a
tsconfig.json
that we extend from, but this might need to be configurable as well.The text was updated successfully, but these errors were encountered: