forked from enisdenjo/graphql-ws
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Descriptive invalid message errors
Closes enisdenjo#366
- Loading branch information
Showing
8 changed files
with
657 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`should report close error even if complete message followed 1`] = `"\\"error\\" message expects the 'payload' property to be an array of GraphQL errors, but got \\"malformed\\""`; | ||
|
||
exports[`should report close error even if complete message followed 2`] = `"\\"error\\" message expects the 'payload' property to be an array of GraphQL errors, but got \\"malformed\\""`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`should report invalid messages with descriptive errors 1`] = `"Message is missing the 'type' property"`; | ||
|
||
exports[`should report invalid messages with descriptive errors 2`] = `"Message is expected to be an object, but got string"`; | ||
|
||
exports[`should report invalid messages with descriptive errors 3`] = `"Message is expected to be an object, but got array"`; | ||
|
||
exports[`should report invalid messages with descriptive errors 4`] = `"Message is expected to be an object, but got number"`; | ||
|
||
exports[`should report invalid messages with descriptive errors 5`] = `"Message is expected to be an object, but got number"`; | ||
|
||
exports[`should report invalid messages with descriptive errors 6`] = `"Message is expected to be an object, but got function"`; | ||
|
||
exports[`should report invalid messages with descriptive errors 7`] = `"Message is expected to be an object, but got function"`; | ||
|
||
exports[`should report invalid messages with descriptive errors 8`] = `"Message is expected to be an object, but got function"`; | ||
|
||
exports[`should report invalid messages with descriptive errors 9`] = `"Message is missing the 'type' property"`; | ||
|
||
exports[`should report invalid messages with descriptive errors 10`] = `"Message is missing the 'type' property"`; | ||
|
||
exports[`should report invalid messages with descriptive errors 11`] = `"Message is missing the 'type' property"`; | ||
|
||
exports[`should report invalid messages with descriptive errors 12`] = `"Invalid message 'type' property \\"nuxt\\""`; | ||
|
||
exports[`should report invalid messages with descriptive errors 13`] = `"\\"connection_init\\" message expects the 'payload' property to be an object or missing, but got \\"\\""`; | ||
|
||
exports[`should report invalid messages with descriptive errors 14`] = `"\\"connection_init\\" message expects the 'payload' property to be an object or missing, but got \\"0\\""`; | ||
|
||
exports[`should report invalid messages with descriptive errors 15`] = `"\\"connection_init\\" message expects the 'payload' property to be an object or missing, but got \\"undefined\\""`; | ||
|
||
exports[`should report invalid messages with descriptive errors 16`] = `"\\"connection_ack\\" message expects the 'payload' property to be an object or missing, but got \\"\\""`; | ||
|
||
exports[`should report invalid messages with descriptive errors 17`] = `"\\"ping\\" message expects the 'payload' property to be an object or missing, but got \\"0\\""`; | ||
|
||
exports[`should report invalid messages with descriptive errors 18`] = `"\\"pong\\" message expects the 'payload' property to be an object or missing, but got \\"undefined\\""`; | ||
|
||
exports[`should report invalid messages with descriptive errors 19`] = `"\\"subscribe\\" message expects the 'id' property to be a string, but got undefined"`; | ||
|
||
exports[`should report invalid messages with descriptive errors 20`] = `"\\"subscribe\\" message expects the 'id' property to be a string, but got number"`; | ||
|
||
exports[`should report invalid messages with descriptive errors 21`] = `"\\"subscribe\\" message requires a non-empty 'id' property"`; | ||
|
||
exports[`should report invalid messages with descriptive errors 22`] = `"\\"subscribe\\" message expects the 'payload' property to be an object, but got undefined"`; | ||
|
||
exports[`should report invalid messages with descriptive errors 23`] = `"\\"subscribe\\" message expects the 'payload' property to be an object, but got array"`; | ||
|
||
exports[`should report invalid messages with descriptive errors 24`] = `"\\"subscribe\\" message expects the 'payload' property to be an object, but got string"`; | ||
|
||
exports[`should report invalid messages with descriptive errors 25`] = `"\\"subscribe\\" message payload expects the 'query' property to be a string, but got undefined"`; | ||
|
||
exports[`should report invalid messages with descriptive errors 26`] = `"\\"subscribe\\" message payload expects the 'query' property to be a string, but got number"`; | ||
|
||
exports[`should report invalid messages with descriptive errors 27`] = `"\\"subscribe\\" message payload expects the 'query' property to be a string, but got object"`; | ||
|
||
exports[`should report invalid messages with descriptive errors 28`] = `"\\"subscribe\\" message payload expects the 'operationName' property to be a string or nullish or missing, but got number"`; | ||
|
||
exports[`should report invalid messages with descriptive errors 29`] = `"\\"subscribe\\" message payload expects the 'operationName' property to be a string or nullish or missing, but got object"`; | ||
|
||
exports[`should report invalid messages with descriptive errors 30`] = `"\\"subscribe\\" message payload expects the 'variables' property to be a an object or nullish or missing, but got string"`; | ||
|
||
exports[`should report invalid messages with descriptive errors 31`] = `"\\"subscribe\\" message payload expects the 'extensions' property to be a an object or nullish or missing, but got string"`; | ||
|
||
exports[`should report invalid messages with descriptive errors 32`] = `"\\"subscribe\\" message payload expects the 'extensions' property to be a an object or nullish or missing, but got number"`; | ||
|
||
exports[`should report invalid messages with descriptive errors 33`] = `"\\"next\\" message expects the 'id' property to be a string, but got undefined"`; | ||
|
||
exports[`should report invalid messages with descriptive errors 34`] = `"\\"next\\" message expects the 'id' property to be a string, but got undefined"`; | ||
|
||
exports[`should report invalid messages with descriptive errors 35`] = `"\\"next\\" message requires a non-empty 'id' property"`; | ||
|
||
exports[`should report invalid messages with descriptive errors 36`] = `"\\"next\\" message expects the 'payload' property to be an object, but got undefined"`; | ||
|
||
exports[`should report invalid messages with descriptive errors 37`] = `"\\"next\\" message expects the 'payload' property to be an object, but got string"`; | ||
|
||
exports[`should report invalid messages with descriptive errors 38`] = `"\\"error\\" message expects the 'id' property to be a string, but got undefined"`; | ||
|
||
exports[`should report invalid messages with descriptive errors 39`] = `"\\"error\\" message requires a non-empty 'id' property"`; | ||
|
||
exports[`should report invalid messages with descriptive errors 40`] = `"\\"error\\" message expects the 'payload' property to be an array of GraphQL errors, but got undefined"`; | ||
|
||
exports[`should report invalid messages with descriptive errors 41`] = `"\\"error\\" message expects the 'payload' property to be an array of GraphQL errors, but got {}"`; | ||
|
||
exports[`should report invalid messages with descriptive errors 42`] = `"\\"error\\" message expects the 'payload' property to be an array of GraphQL errors, but got \\"\\""`; | ||
|
||
exports[`should report invalid messages with descriptive errors 43`] = `"\\"error\\" message expects the 'payload' property to be an array of GraphQL errors, but got []"`; | ||
|
||
exports[`should report invalid messages with descriptive errors 44`] = `"\\"error\\" message expects the 'payload' property to be an array of GraphQL errors, but got [{\\"iam\\":\\"invalid\\"}]"`; | ||
|
||
exports[`should report invalid messages with descriptive errors 45`] = `"\\"complete\\" message expects the 'id' property to be a string, but got undefined"`; | ||
|
||
exports[`should report invalid messages with descriptive errors 46`] = `"\\"complete\\" message requires a non-empty 'id' property"`; | ||
|
||
exports[`should report invalid messages with descriptive errors 47`] = `"\\"complete\\" message expects the 'id' property to be a string, but got number"`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.