-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
fix(misc): update e2e config generators to align with new TS solution setup #29638
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
View your CI Pipeline Execution ↗ for commit d55ad0e.
☁️ Nx Cloud last updated this comment at |
43b567d
to
72f9c8f
Compare
@@ -1,7 +1,6 @@ | |||
import { defineConfig, devices } from '@playwright/test'; | |||
import { nxE2EPreset } from '@nx/playwright/preset'; | |||
<% if(!webServerCommand || !webServerAddress) { %>// eslint-disable-next-line @typescript-eslint/no-unused-vars <% } %> | |||
import { workspaceRoot } from '@nx/devkit'; | |||
<% if (webServerCommand && webServerAddress) { %>import { workspaceRoot } from '@nx/devkit';<% } %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This import is unused unless both options are set, which leads to typecheck errors in the new setup. We should just not import it if we're not going to use it.
72f9c8f
to
19eb0d0
Compare
19eb0d0
to
5708c40
Compare
5708c40
to
d55ad0e
Compare
… setup (#29638) This PR updates the `@nx/detox:app` generator to match the new TS solution setup. The `@nx/cypress:configuration` and `@nx/cypress:configuration` generators are also updated so that they can be run on existing projects and generator the correct tsconfig files. The Playwright/Cypress example can be seen as follows: ```shell # Skip e2e nx g @nx/react:app apps/demo --bundler vite --e2eTestRunner none # now configure e2e nx g @nx/playwright --project demo ``` Now if you add this line to `apps/demo/e2e/example.spec.ts`: ``` const x: number = 'a'; ``` And run `nx typecheck demo`, it will pass. This happens because the `e2e/**/*.ts` pattern is missing. Thus, we need to ensure that a `tsconfig.e2e.json` project is added for the Playwright spec files. Same thing with Cypress. The Detox generator does not support adding configuration to existing project, so we don't quite get the same problem. The fix for Detox is just to make sure the tsconfig content is not following the old (integrated) version, but the updated TS solution version. ## Current Behavior Detox TS setup is incorrect. Running Cypress and Playwright configuration generator on existing projects generate invalid setup, such that spec files are not typechecked. ## Expected Behavior E2E generators should all generate correct TS setup. ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes # (cherry picked from commit 1e032fb)
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
This PR updates the
@nx/detox:app
generator to match the new TS solution setup. The@nx/cypress:configuration
and@nx/cypress:configuration
generators are also updated so that they can be run on existing projects and generator the correct tsconfig files.The Playwright/Cypress example can be seen as follows:
Now if you add this line to
apps/demo/e2e/example.spec.ts
:And run
nx typecheck demo
, it will pass. This happens because thee2e/**/*.ts
pattern is missing. Thus, we need to ensure that atsconfig.e2e.json
project is added for the Playwright spec files. Same thing with Cypress.The Detox generator does not support adding configuration to existing project, so we don't quite get the same problem. The fix for Detox is just to make sure the tsconfig content is not following the old (integrated) version, but the updated TS solution version.
Current Behavior
Detox TS setup is incorrect. Running Cypress and Playwright configuration generator on existing projects generate invalid setup, such that spec files are not typechecked.
Expected Behavior
E2E generators should all generate correct TS setup.
Related Issue(s)
Fixes #