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 === 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({
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue