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,15 +161,13 @@ 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(
JSON.stringify({
data: {}, data: {},
errors: [rootValue] errors: [rootValue]
}) }
) }
); );
} }