-
Notifications
You must be signed in to change notification settings - Fork 25
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
Jest 28 failure: should return an object or a Promise resolving to an object #13
Comments
+1 also running into this error |
+1 also running into this error. |
@granttchart Have you found a workaround for this? |
Folks ending up here might have some luck switching to this: |
@graphql-tools/jest-transform isn't quite compatible, and doesn't allow multiple operations per file. |
Worked for me!;
|
I was trying to use
|
The above link to the resolution/explanation results in 404. |
The first link should be https://jestjs.io/docs/28.x/upgrading-to-jest28#transformer. |
Should be able to do something like this then: jest.config.js: {
"jest": {
"transform": {
"\\.(gql|graphql)$": "./transform-graphql-jest-28-shim.js"
}
}
} transform-graphql-jest-28-shim.js: const { process: upstreamProcess } = require('jest-transform-graphql');
const process = (...args) => {
const code = upstreamProcess(...args);
return { code };
};
module.exports = { process }; |
Thank you @SethDavenport this is a great solution. |
Neither of these workarounds worked jest 29.6.4 in a Typescript project It works fine in rollup build but I am unit testing my source. |
thought i had this too, try running |
This was a life saver. Thank you very much |
The following error is being thrown on Jest 28.1.0 due to Jest breaking changes. https://jestjs.io/docs/upgrading-to-jest28#transformer explains the necessary fix.
The text was updated successfully, but these errors were encountered: