-
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(testing): handle more complex projects for react component testing #11725
Merged
barbados-clemens
merged 4 commits into
nrwl:master
from
barbados-clemens:fix/react-component-testing
Aug 30, 2022
Merged
fix(testing): handle more complex projects for react component testing #11725
barbados-clemens
merged 4 commits into
nrwl:master
from
barbados-clemens:fix/react-component-testing
Aug 30, 2022
Conversation
This file contains 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
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
barbados-clemens
added
the
scope: testing tools
Issues related to Cypress / Jest / Playwright / Vitest support in Nx
label
Aug 25, 2022
barbados-clemens
force-pushed
the
fix/react-component-testing
branch
from
August 25, 2022 20:07
be2724b
to
d5a43ab
Compare
barbados-clemens
force-pushed
the
fix/react-component-testing
branch
5 times, most recently
from
August 26, 2022 16:35
d107318
to
f26cb15
Compare
packages/cypress/src/generators/cypress-component-project/cypress-component-project.ts
Outdated
Show resolved
Hide resolved
packages/cypress/src/migrations/update-14-6-1/update-cypress-configs-presets.spec.ts
Outdated
Show resolved
Hide resolved
forEachExecutorOptions<CypressExecutorOptions>( | ||
tree, | ||
'@nrwl/cypress:cypress', | ||
(options, projectName, targetName, configName) => { |
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.
make this handle async callback (maybe follow up PR)
packages/cypress/src/migrations/update-14-6-1/update-cypress-configs-presets.ts
Outdated
Show resolved
Hide resolved
...ages/react/src/generators/cypress-component-configuration/cypress-component-configuration.ts
Show resolved
Hide resolved
packages/react/src/generators/cypress-component-configuration/schema.json
Show resolved
Hide resolved
barbados-clemens
force-pushed
the
fix/react-component-testing
branch
from
August 30, 2022 15:02
f26cb15
to
b7da595
Compare
AgentEnder
requested changes
Aug 30, 2022
barbados-clemens
force-pushed
the
fix/react-component-testing
branch
from
August 30, 2022 15:36
b7da595
to
6f5445b
Compare
AgentEnder
approved these changes
Aug 30, 2022
barbados-clemens
force-pushed
the
fix/react-component-testing
branch
from
August 30, 2022 16:22
6f5445b
to
30d99d1
Compare
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. |
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 change will now use
@nrwl/web:webpack
utilities and requires a build target to be provided in the@nrwl/cypress:cypress
executor options. UsingnxComponentTestingPreset
will load the@nrwl/web:webpack
executor options from the provided build target in order to create the webpack configuration for cypress dev server. As of right now, if it's unable to build the webpack configuration, it will fallback to the default configuration that was there before. Which will handle simple cases/can be extended as needed.When generating a new component testing configuration, a new option for --build-target is available. this allows for manually specifying the target to use for component testing. If one isn't provided the project graph is used to try to find an existing valid build configuration by looking for parent projects that use
@nrwl/web:webpack
(i.e. a React App)Potential issues
if working in a workspace without a project using
@nrwl/web:webpack
i.e. a publishable react lib without apps. 2 options.@nrwl/cypress:cypress
to accept a full configuration for@nrwl/web:webpack
/ make a new component testing executor that has these options (might not be ideal as new frameworks might have different needs i.e. angular)@nrwl/web:webpack
and pass to the component testing options. i.e. make a dummy app or add a customct-build
target with@nrwl/web:webpack
in the current project.Current Behavior
the default webpack configuration used for cypress component testing (in react) fails when having more "complex" set ups i.e. tailwinds via setup-tailwinds generator.
Expected Behavior
things automagically work.
Related Issue(s)
Fixes #11372
Fixes #11509