From 125bec2cbb49386bb260e4f564df62c6a8401407 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Wed, 29 Jan 2025 11:11:07 -0700 Subject: [PATCH] Fix failing graphqlSubscriptions tests --- .../graphqlSubscriptions.ts.snap | 16 ++++------- src/__tests__/graphqlSubscriptions.ts | 28 ++++++++----------- 2 files changed, 17 insertions(+), 27 deletions(-) diff --git a/src/__tests__/__snapshots__/graphqlSubscriptions.ts.snap b/src/__tests__/__snapshots__/graphqlSubscriptions.ts.snap index cec1ed33bf9..8497fae92f5 100644 --- a/src/__tests__/__snapshots__/graphqlSubscriptions.ts.snap +++ b/src/__tests__/__snapshots__/graphqlSubscriptions.ts.snap @@ -40,11 +40,9 @@ ApolloError { exports[`GraphQL Subscriptions should throw an error if the result has protocolErrors on it 1`] = ` ApolloError { "cause": Object { - "extensions": Array [ - Object { - "code": "WEBSOCKET_MESSAGE_ERROR", - }, - ], + "extensions": Object { + "code": "WEBSOCKET_MESSAGE_ERROR", + }, "message": "cannot read message from websocket", }, "clientErrors": Array [], @@ -55,11 +53,9 @@ ApolloError { "networkError": null, "protocolErrors": Array [ Object { - "extensions": Array [ - Object { - "code": "WEBSOCKET_MESSAGE_ERROR", - }, - ], + "extensions": Object { + "code": "WEBSOCKET_MESSAGE_ERROR", + }, "message": "cannot read message from websocket", }, ], diff --git a/src/__tests__/graphqlSubscriptions.ts b/src/__tests__/graphqlSubscriptions.ts index 492134c11ed..d553f3b802d 100644 --- a/src/__tests__/graphqlSubscriptions.ts +++ b/src/__tests__/graphqlSubscriptions.ts @@ -275,11 +275,9 @@ describe("GraphQL Subscriptions", () => { [PROTOCOL_ERRORS_SYMBOL]: [ { message: "cannot read message from websocket", - extensions: [ - { - code: "WEBSOCKET_MESSAGE_ERROR", - }, - ], + extensions: { + code: "WEBSOCKET_MESSAGE_ERROR", + }, } as any, ], }, @@ -388,12 +386,10 @@ describe("GraphQL Subscriptions", () => { [PROTOCOL_ERRORS_SYMBOL]: [ { message: "cannot read message from websocket", - extensions: [ - { - code: "WEBSOCKET_MESSAGE_ERROR", - }, - ], - } as any, + extensions: { + code: "WEBSOCKET_MESSAGE_ERROR", + }, + }, ], }, }, @@ -482,12 +478,10 @@ describe("GraphQL Subscriptions", () => { [PROTOCOL_ERRORS_SYMBOL]: [ { message: "cannot read message from websocket", - extensions: [ - { - code: "WEBSOCKET_MESSAGE_ERROR", - }, - ], - } as any, + extensions: { + code: "WEBSOCKET_MESSAGE_ERROR", + }, + }, ], }, },