-
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(react-native): update generated jest config to be in sync w/cache #18366
fix(react-native): update generated jest config to be in sync w/cache #18366
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
278ca7f
to
c85f4c8
Compare
@@ -32,9 +32,13 @@ export async function addJest( | |||
resolver: '@nx/jest/plugins/resolver', | |||
moduleFileExtensions: ['ts', 'js', 'html', 'tsx', 'jsx'], | |||
setupFilesAfterEnv: ['<rootDir>/test-setup.${js ? 'js' : 'ts'}'], | |||
transformIgnorePatterns: ['node_modules/(?!react-native|jest-runner)/'], |
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.
by default, react native jest preset already has a transformIgnorePatterns like:
https://github.com/facebook/react-native/blob/main/packages/react-native/jest-preset.js#L24
'node_modules/(?!((jest-)?react-native|@react-native(-community)?)/)',
is this still needed?
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.
in that case probably not. I assume it's just extra deps that were added that ended up needing the patterns without realize it. I'll remove. 👍
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.
@barbados-clemens Oups, i'm a bit late !
This is still needed apparently.
Easy to reproduce: create a bare project, add lib, launch tests, and you'll get something like
Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.
Add the transformIgnorePatterns and the test passes.
If the preset adds it by default, it seems like it gets overridden somewhere hmm
c85f4c8
to
b28876d
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. |
Current Behavior
Jest config generates coverage reports in the project root, which does not match executor outputs nor the other existing project outputs
jest config doesn't transform common deps
Expected Behavior
jest config is updated to support the above 2
Related Issue(s)
Fixes #