nx generator for cypress component tests doesn't generate correct tsconfigs #19569
Closed
1 of 4 tasks
Labels
outdated
scope: testing tools
Issues related to Cypress / Jest / Playwright / Vitest support in Nx
stale
type: bug
Current Behavior
Running
generates config and folders for cypress component testing.
![Screenshot 2023-10-12 at 00 07 41](https://private-user-images.githubusercontent.com/54899662/274418349-0b89fe3c-96a5-4c64-8393-a445d200bdc7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA3NTgyMjAsIm5iZiI6MTcyMDc1NzkyMCwicGF0aCI6Ii81NDg5OTY2Mi8yNzQ0MTgzNDktMGI4OWZlM2MtOTZhNS00YzY0LTgzOTMtYTQ0NWQyMDBiZGM3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzEyVDA0MTg0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg0ZTA1YzYyODI0NzllNjQ4ODBmYzk0NzlmNDVhM2M2MzYwMzc4YjUzNTcxMGRlNWYwYWE0ODMxMTAzOWM2NjEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.OEHRmcdSuIRk39j94Rr-3XQysnon_OXUk4syZGI8FT0)
However,
cy
is not recognized at allI spent quite a lot of time trying to figure out what's wrong, but I failed.
including
commands.ts
file in tsconfig.ts, didn't help.I could reproduce it even on a fresh project.
Expected Behavior
SHould be able to use cypress component testing without any typescript problems
GitHub Repo
I didn't do anything to tsconfig files - just what was generated by nx
https://github.com/tar-aldev/nrwl-nx-cypress-component-testing-issues
Steps to Reproduce
cy.mount()
Result: it will show the message
Nx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
I see this part added under
/app/tsconfig.json
As soon as I remove this, it seems to start working just fine.
But then I start getting a lot of troubles with jest tests too. Cypress assertions conflict with jest ones.
If I add this to
exclude
oftsconfig.json
it helps with assertion ts errors, but then it starts complaining about imports from
@org/lib-name
which are other libs created with nx.So just to be sure. the structure is like this
tsconfig.json file looks like this
tsconfig.spec.json
cypress/tsconfig.json
The text was updated successfully, but these errors were encountered: