fix(misc): update e2e config generators to align with new TS solution setup#29638
Merged
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
|
Contributor
|
View your CI Pipeline Execution ↗ for commit d55ad0e.
☁️ Nx Cloud last updated this comment at |
43b567d to
72f9c8f
Compare
jaysoo
commented
Jan 15, 2025
| 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';<% } %> |
Member
Author
There was a problem hiding this comment.
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
Coly010
approved these changes
Jan 15, 2025
19eb0d0 to
5708c40
Compare
leosvelperez
approved these changes
Jan 16, 2025
xiongemi
approved these changes
Jan 16, 2025
5708c40 to
d55ad0e
Compare
FrozenPandaz
pushed a commit
that referenced
this pull request
Jan 17, 2025
… 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)
Contributor
|
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR updates the
@nx/detox:appgenerator to match the new TS solution setup. The@nx/cypress:configurationand@nx/cypress:configurationgenerators 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/**/*.tspattern is missing. Thus, we need to ensure that atsconfig.e2e.jsonproject 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 #