Fix handling of errors in cypress tests

This commit is contained in:
Ramon Wenger 2022-10-17 16:26:30 +02:00
parent 442a50e29d
commit a7ad48f34b
1 changed files with 8 additions and 10 deletions

View File

@ -161,16 +161,14 @@ Cypress.Commands.add('mockGraphql', (options?: any) => {
rootValue.constructor === GraphQLError || rootValue.constructor === GraphQLError ||
rootValue.constructor.name === "GraphQLError" rootValue.constructor.name === "GraphQLError"
) { ) {
return Promise.resolve() return req.reply(
.then( {
() => body: {
new Response( data: {},
JSON.stringify({ errors: [rootValue]
data: {}, }
errors: [rootValue] }
}) );
)
);
} }
graphql({ graphql({