Fix handling of errors in cypress tests
This commit is contained in:
parent
442a50e29d
commit
a7ad48f34b
|
|
@ -161,16 +161,14 @@ Cypress.Commands.add('mockGraphql', (options?: any) => {
|
|||
rootValue.constructor === GraphQLError ||
|
||||
rootValue.constructor.name === "GraphQLError"
|
||||
) {
|
||||
return Promise.resolve()
|
||||
.then(
|
||||
() =>
|
||||
new Response(
|
||||
JSON.stringify({
|
||||
data: {},
|
||||
errors: [rootValue]
|
||||
})
|
||||
)
|
||||
);
|
||||
return req.reply(
|
||||
{
|
||||
body: {
|
||||
data: {},
|
||||
errors: [rootValue]
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
graphql({
|
||||
|
|
|
|||
Loading…
Reference in New Issue