-
Notifications
You must be signed in to change notification settings - Fork 429
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
Running relay tests #410
Comments
Thank you for the repo link - it was very helpful, because it meant I could test what I was about to suggest. React-app-rewired turns on processing of your Try adding the following to your "babel": {
"env": {
"test": {
"plugins": [
"relay"
]
}
}
} After adding that bit, your tests ran but the sequelize ones complained about having the wrong password/wrong number of assertions. The graphql tests passed. The graphql error you quoted is gone, so I believe that the relay plugin is being used properly. |
Thank you very much for you quick response. It worked. I guess that is equivalent of adding {
"env": {
"test": {
"plugins": [
"relay"
]
}
}
} in the |
The settings that are in config-overrides.js are not applied to tests. context: timarney/react-app-rewired#410
It all worked out: sepans/ctzen#19 Taking the liberty and closing the issue. Thanks for your help. |
I have a relay app that was created with CRA and it is working just fine with the config-overrides:
But when running tests I get the error:
Invariant Violation: graphql: Unexpected invocation at runtime. Either the Babel transform was not set up, or it failed to identify this call site. Make sure it is being used verbatim as 'graphql'
which should be an indication that the relay babel plugin is not loaded. I read through #240 and #241 and as I understood it those overrides are not applied to jest test settings but I am a bit confused how exactly it needs to be setup (sorry the great tools you developed made me lazy and never learned those settings in depth ❤️ ).
A will greatly appreciate your help figuring this out.
Thank you.
PS: the code I am working on is here
The text was updated successfully, but these errors were encountered: