From 3507a4d2ae6eac47c0690c75a0e69facf11a4e3a Mon Sep 17 00:00:00 2001 From: Anshuman Verma Date: Fri, 21 May 2021 11:47:39 +0530 Subject: [PATCH] chore: update --- lib/options.json | 6 ------ .../validate-options.test.js.snap.webpack4 | 18 +++++++++++------- test/validate-options.test.js | 8 +++++--- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/options.json b/lib/options.json index 449a0b7f61..97c5df0cfd 100644 --- a/lib/options.json +++ b/lib/options.json @@ -304,12 +304,6 @@ "anyOf": [ { "type": "number" - }, - { - "type": "string" - }, - { - "enum": ["auto"] } ], "description": "Tells clients connected to devServer to use the provided path to connect." diff --git a/test/__snapshots__/validate-options.test.js.snap.webpack4 b/test/__snapshots__/validate-options.test.js.snap.webpack4 index 1c0d0157a4..872d30c724 100644 --- a/test/__snapshots__/validate-options.test.js.snap.webpack4 +++ b/test/__snapshots__/validate-options.test.js.snap.webpack4 @@ -577,16 +577,20 @@ exports[`options validate should throw an error on the "webSocketURL" option wit -> Tells clients connected to devServer to use the provided path to connect." `; +exports[`options validate should throw an error on the "webSocketURL" option with '{"port":""}' value 1`] = ` +"ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. + - configuration.webSocketURL should be one of these: + string | object { host?, path?, port?, … } + Details: + * configuration.webSocketURL.port should be a number. + -> Tells clients connected to devServer to use the provided path to connect." +`; + exports[`options validate should throw an error on the "webSocketURL" option with '{"port":true}' value 1`] = ` "ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration.webSocketURL should be one of these: string | object { host?, path?, port?, … } Details: - * configuration.webSocketURL.port should be one of these: - number | string | \\"auto\\" - -> Tells clients connected to devServer to use the provided path to connect. - Details: - * configuration.webSocketURL.port should be a number. - * configuration.webSocketURL.port should be a string. - * configuration.webSocketURL.port should be \\"auto\\"." + * configuration.webSocketURL.port should be a number. + -> Tells clients connected to devServer to use the provided path to connect." `; diff --git a/test/validate-options.test.js b/test/validate-options.test.js index de529a3c71..e107b0583d 100644 --- a/test/validate-options.test.js +++ b/test/validate-options.test.js @@ -293,17 +293,16 @@ const tests = { path: '', }, { - port: '', + port: 8080, }, { host: '', path: '', - port: '', }, { host: '', path: '', - port: 'auto', + port: 8080, }, ], failure: [ @@ -318,6 +317,9 @@ const tests = { { port: true, }, + { + port: '', + }, ], }, webSocketServer: {