Skip to content
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

Exlude graphql and gql from fileTransform pattern #29

Merged
merged 1 commit into from
Mar 9, 2018

Conversation

bmatto
Copy link

@bmatto bmatto commented Mar 6, 2018

In packages/react-scripts/scripts/utils/createJestConfig.js the transform config block contains a pattern to use fileTransform. The regex for that block of code is a catch all for extensions not referenced. Though graphql and gql have there own pattern which intends to use the jest-transform-graphql module, that pattern is not used because of the aforementioned catch all. This PR simply adds those extensions to allow them to be caught by the intended loader.

I should also note that in create-react-app on the next branch, there is a commit which does something very similar to the zeal block for graphql files. However in the mean time, graphql loading for jest is not working, in that a graphql file loaded in jest is converted to a stringified name via the fileTransform

@randycoulman randycoulman merged commit 39a3daa into CodingZeal:zeal Mar 9, 2018
@randycoulman
Copy link

Good catch, thanks! Change looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants