-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(server): serverMode 'ws' option (#2082)
* feat(server): server mode ws string option * test(server): rearrange bad host test * test(server): added mock server implementation tests * test(server): remove bad host test temporarily * test(server): re added bad host test
- Loading branch information
1 parent
aa31d87
commit 04483f4
Showing
4 changed files
with
528 additions
and
245 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,91 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`serverMode option with a bad host header results in an error 1`] = ` | ||
exports[`serverMode option passed to server with a bad host header results in an error 1`] = ` | ||
Array [ | ||
"open", | ||
"{\\"type\\":\\"error\\",\\"data\\":\\"Invalid Host/Origin header\\"}", | ||
"close", | ||
] | ||
`; | ||
|
||
exports[`serverMode option without a header results in an error 1`] = ` | ||
exports[`serverMode option passed to server without a header results in an error 1`] = ` | ||
Array [ | ||
"open", | ||
"{\\"type\\":\\"error\\",\\"data\\":\\"Invalid Host/Origin header\\"}", | ||
"close", | ||
] | ||
`; | ||
|
||
exports[`serverMode option server should close client with bad headers 1`] = ` | ||
Array [ | ||
Array [ | ||
[Function], | ||
], | ||
] | ||
`; | ||
|
||
exports[`serverMode option server should close client with bad headers 2`] = ` | ||
Array [ | ||
Array [ | ||
Object { | ||
"foo": "bar", | ||
}, | ||
"{\\"type\\":\\"error\\",\\"data\\":\\"Invalid Host/Origin header\\"}", | ||
], | ||
] | ||
`; | ||
|
||
exports[`serverMode option server should close client with bad headers 3`] = ` | ||
Array [ | ||
Array [ | ||
Object { | ||
"foo": "bar", | ||
}, | ||
], | ||
] | ||
`; | ||
|
||
exports[`serverMode option server should use server implementation correctly 1`] = ` | ||
Array [ | ||
Object { | ||
"foo": "bar", | ||
}, | ||
] | ||
`; | ||
|
||
exports[`serverMode option server should use server implementation correctly 2`] = ` | ||
Array [ | ||
Array [ | ||
[Function], | ||
], | ||
] | ||
`; | ||
|
||
exports[`serverMode option server should use server implementation correctly 3`] = ` | ||
Array [ | ||
Object { | ||
"foo": "bar", | ||
}, | ||
"{\\"type\\":\\"liveReload\\"}", | ||
] | ||
`; | ||
|
||
exports[`serverMode option server should use server implementation correctly 4`] = ` | ||
Array [ | ||
Object { | ||
"foo": "bar", | ||
}, | ||
"{\\"type\\":\\"ok\\"}", | ||
] | ||
`; | ||
|
||
exports[`serverMode option server should use server implementation correctly 5`] = ` | ||
Array [ | ||
Array [ | ||
Object { | ||
"foo": "bar", | ||
}, | ||
[Function], | ||
], | ||
] | ||
`; |
Oops, something went wrong.