-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
feat(testing): add setupFilesAfterEnv and other configs to project's jest config file #3224
Merged
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
Cammisuli
changed the title
WIP: feat(testing): add setupEnv and other configs to project's jest config file
WIP: feat(testing): add setupFilesAfterEnv and other configs to project's jest config file
Jun 23, 2020
Cammisuli
force-pushed
the
update-jest-configs
branch
from
June 24, 2020 12:31
58f3525
to
a451a56
Compare
Will they ever merge this? I think this is kind of important. |
@levani132 yea, that's the plan. I'm hoping to get this in sometime this week 😄 |
Cammisuli
force-pushed
the
update-jest-configs
branch
from
July 3, 2020 12:46
a451a56
to
8924ca9
Compare
Cammisuli
force-pushed
the
update-jest-configs
branch
from
July 3, 2020 20:19
0ec71de
to
498b002
Compare
…tests using the setupfile rather than builder
Cammisuli
changed the title
WIP: feat(testing): add setupFilesAfterEnv and other configs to project's jest config file
feat(testing): add setupFilesAfterEnv and other configs to project's jest config file
Jul 7, 2020
Cammisuli
force-pushed
the
update-jest-configs
branch
from
July 10, 2020 21:39
684d90f
to
ba2e88b
Compare
@FrozenPandaz this should be ready to merge now. I updated the migration to run on beta.2 as well. |
Doginal
pushed a commit
to Doginal/nx
that referenced
this pull request
Nov 25, 2020
… jest config file (nrwl#3224) * feat(testing): add util to update jest configs. * feat(testing): place configurations in jest config file rather than just the builder * feat(testing): create migration and unit tests * feat(testing): fix jest template * feat(testing): fix jest template to correct unit tests * feat(testing): include globals.ts-jest for all non babel configs * feat(testing): include globals.ts-jest for node e2e * feat(testing): fix migration to run properly. Also check for angular tests using the setupfile rather than builder * feat(testing): clean up jest config functions and fix errors with some migrations * feat(testing): add new line to package.json * feat(testing): update object check to actually check for undefined * chore(testing): loop through all project targets as well as targets * chore(testing): update migration to be 10.0.0-beta.2
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.
Completed:
There's a limitation that the config updater will only work if the jest.config.js follows this format:
setupFilesAfterEnv
and other necessary onesCurrent Behavior
The jest builder automatically populates the jest config with some properties that should be in the config file from the start. This causes issues when trying to run the Jest tests in an IDE environment, because they do not understand how nx builders work.
Expected Behavior
The jest.config.js file should contain the nessecesary properties needed to be able to run tests in IDEs.
Related Issue(s)
Fixes 747(I was hoping that this would fix vscode issues, but there's no extension currently that supports multiple jest configs. The ones I found usually expected one at the root. Perhaps we can create one or update Nx Console to support Jest runs in vscode 🤔 )Fixes #2314