test: enable allowed-hosts.test.js #69
Merged
+565
−50
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request updates and expands the snapshot tests for allowed hosts and host header handling in the webpack-dev-server test suite. The changes include new test cases for different host and origin scenarios, improved output for error responses, and more detailed console and error message tracking for various websocket connection types.
The most important changes are:
Expanded test coverage for allowed hosts:
options.allowedHostsis set toauto, covering cases where the host is specified directly or viaclient.webSocketURL, and for various host values such as[::1],0.0.0.0,127.0.0.1, andlocalhost, across both"sockjs"and"ws"websocket transports. [1] [2]New origin header handling tests:
"auto"allowed hosts setting, for both"sockjs"and"ws"transports.Improved error response and console output validation:
<meta name="color-scheme" content="light dark">tag and improved formatting, and updated the expected console messages for forbidden (403) responses.Default host handling tests:
"localhost"are allowed by default for both"sockjs"and"ws"transports, with corresponding console and error message expectations.Detailed reconnection and error flow tests: