-
-
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.
- Loading branch information
Showing
3 changed files
with
402 additions
and
61 deletions.
There are no files selected for viewing
File renamed without changes.
341 changes: 341 additions & 0 deletions
341
test/__snapshots__/validate-options.test.js.snap.webpack5
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,341 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`options validation bonjour 1`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.bonjour should be a boolean." | ||
`; | ||
|
||
exports[`options validation client 1`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.client should be an object: | ||
object { host?, path?, port?, logging?, progress?, overlay?, needClientEntry?, needHotEntry? }" | ||
`; | ||
|
||
exports[`options validation client 2`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.client has an unknown property 'unknownOption'. These properties are valid: | ||
object { host?, path?, port?, logging?, progress?, overlay?, needClientEntry?, needHotEntry? }" | ||
`; | ||
|
||
exports[`options validation client 3`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.client.host should be a string." | ||
`; | ||
|
||
exports[`options validation client 4`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.client.logging should be one of these: | ||
\\"none\\" | \\"error\\" | \\"warn\\" | \\"info\\" | \\"log\\" | \\"verbose\\"" | ||
`; | ||
|
||
exports[`options validation client 5`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.client.logging should be one of these: | ||
\\"none\\" | \\"error\\" | \\"warn\\" | \\"info\\" | \\"log\\" | \\"verbose\\"" | ||
`; | ||
|
||
exports[`options validation client 6`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.client.progress should be a boolean." | ||
`; | ||
|
||
exports[`options validation client 7`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.client.overlay should be one of these: | ||
boolean | object { errors?, warnings?, … } | ||
Details: | ||
* configuration.client.overlay should be a boolean. | ||
* configuration.client.overlay should be an object: | ||
object { errors?, warnings?, … }" | ||
`; | ||
|
||
exports[`options validation client 8`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.client.overlay.errors should be a boolean." | ||
`; | ||
|
||
exports[`options validation client 9`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.client.overlay.warnings should be a boolean." | ||
`; | ||
|
||
exports[`options validation client 10`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.client.needClientEntry should be one of these: | ||
boolean | function | ||
Details: | ||
* configuration.client.needClientEntry should be a boolean. | ||
* configuration.client.needClientEntry should be an instance of function." | ||
`; | ||
|
||
exports[`options validation client 11`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.client.needHotEntry should be one of these: | ||
boolean | function | ||
Details: | ||
* configuration.client.needHotEntry should be a boolean. | ||
* configuration.client.needHotEntry should be an instance of function." | ||
`; | ||
|
||
exports[`options validation compress 1`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.compress should be a boolean." | ||
`; | ||
|
||
exports[`options validation dev 1`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.dev should be an object: | ||
object { … }" | ||
`; | ||
|
||
exports[`options validation firewall 1`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.firewall should be one of these: | ||
boolean | [string, ...] (should not have fewer than 1 item) | ||
Details: | ||
* configuration.firewall should be a boolean. | ||
* configuration.firewall should be an array: | ||
[string, ...] (should not have fewer than 1 item)" | ||
`; | ||
|
||
exports[`options validation firewall 2`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.firewall should be an non-empty array." | ||
`; | ||
|
||
exports[`options validation headers 1`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.headers should be an object: | ||
object { … }" | ||
`; | ||
|
||
exports[`options validation historyApiFallback 1`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.historyApiFallback should be one of these: | ||
boolean | object { … } | ||
Details: | ||
* configuration.historyApiFallback should be a boolean. | ||
* configuration.historyApiFallback should be an object: | ||
object { … }" | ||
`; | ||
|
||
exports[`options validation host 1`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.host should be one of these: | ||
string | null | ||
Details: | ||
* configuration.host should be a string. | ||
* configuration.host should be a null." | ||
`; | ||
|
||
exports[`options validation hot 1`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.hot should be one of these: | ||
boolean | \\"only\\" | ||
Details: | ||
* configuration.hot should be a boolean. | ||
* configuration.hot should be \\"only\\"." | ||
`; | ||
|
||
exports[`options validation hot 2`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.hot should be one of these: | ||
boolean | \\"only\\" | ||
Details: | ||
* configuration.hot should be a boolean. | ||
* configuration.hot should be \\"only\\"." | ||
`; | ||
|
||
exports[`options validation http2 1`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.http2 should be a boolean." | ||
`; | ||
|
||
exports[`options validation https 1`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.https should be one of these: | ||
boolean | object { passphrase?, requestCert?, ca?, key?, pfx?, cert? } | ||
Details: | ||
* configuration.https should be a boolean. | ||
* configuration.https should be an object: | ||
object { passphrase?, requestCert?, ca?, key?, pfx?, cert? }" | ||
`; | ||
|
||
exports[`options validation https 2`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.https has an unknown property 'foo'. These properties are valid: | ||
object { passphrase?, requestCert?, ca?, key?, pfx?, cert? }" | ||
`; | ||
|
||
exports[`options validation onAfterSetupMiddleware 1`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.onAfterSetupMiddleware should be an instance of function." | ||
`; | ||
|
||
exports[`options validation onBeforeSetupMiddleware 1`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.onBeforeSetupMiddleware should be an instance of function." | ||
`; | ||
|
||
exports[`options validation onListening 1`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.onListening should be an instance of function." | ||
`; | ||
|
||
exports[`options validation open 1`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.open should be an non-empty string." | ||
`; | ||
|
||
exports[`options validation open 2`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.open should be an non-empty array." | ||
`; | ||
|
||
exports[`options validation open 3`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.open has an unknown property 'foo'. These properties are valid: | ||
object { target?, app? }" | ||
`; | ||
|
||
exports[`options validation port 1`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.port should be one of these: | ||
number | string | null | ||
Details: | ||
* configuration.port should be a number. | ||
* configuration.port should be a string. | ||
* configuration.port should be a null." | ||
`; | ||
|
||
exports[`options validation proxy 1`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.proxy should be an non-empty array." | ||
`; | ||
|
||
exports[`options validation proxy 2`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.proxy should be one of these: | ||
object { … } | [object { … } | function, ...] (should not have fewer than 1 item) | ||
Details: | ||
* configuration.proxy should be an object: | ||
object { … } | ||
* configuration.proxy should be an array: | ||
[object { … } | function, ...] (should not have fewer than 1 item)" | ||
`; | ||
|
||
exports[`options validation proxy 3`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.proxy should be one of these: | ||
object { … } | [object { … } | function, ...] (should not have fewer than 1 item) | ||
Details: | ||
* configuration.proxy should be an object: | ||
object { … } | ||
* configuration.proxy should be an array: | ||
[object { … } | function, ...] (should not have fewer than 1 item)" | ||
`; | ||
|
||
exports[`options validation public 1`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.public should be a string." | ||
`; | ||
|
||
exports[`options validation static 1`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.static should be one of these: | ||
boolean | non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? } | [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] (should not have fewer than 1 item) | ||
Details: | ||
* configuration.static should be a boolean. | ||
* configuration.static should be a non-empty string. | ||
* configuration.static should be an object: | ||
object { directory?, staticOptions?, publicPath?, serveIndex?, watch? } | ||
* configuration.static should be an array: | ||
[non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] (should not have fewer than 1 item)" | ||
`; | ||
|
||
exports[`options validation static 2`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.static should be one of these: | ||
boolean | non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? } | [non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] (should not have fewer than 1 item) | ||
Details: | ||
* configuration.static should be a boolean. | ||
* configuration.static should be a non-empty string. | ||
* configuration.static should be an object: | ||
object { directory?, staticOptions?, publicPath?, serveIndex?, watch? } | ||
* configuration.static should be an array: | ||
[non-empty string | object { directory?, staticOptions?, publicPath?, serveIndex?, watch? }, ...] (should not have fewer than 1 item)" | ||
`; | ||
|
||
exports[`options validation static 3`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.static should be an non-empty string." | ||
`; | ||
|
||
exports[`options validation transportMode 1`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.transportMode should be one of these: | ||
object { client?, server? } | \\"sockjs\\" | \\"ws\\" | ||
Details: | ||
* configuration.transportMode should be an object: | ||
object { client?, server? } | ||
* configuration.transportMode should be one of these: | ||
\\"sockjs\\" | \\"ws\\"" | ||
`; | ||
|
||
exports[`options validation transportMode 2`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.transportMode should be one of these: | ||
object { client?, server? } | \\"sockjs\\" | \\"ws\\" | ||
Details: | ||
* configuration.transportMode should be an object: | ||
object { client?, server? } | ||
* configuration.transportMode should be one of these: | ||
\\"sockjs\\" | \\"ws\\"" | ||
`; | ||
|
||
exports[`options validation transportMode 3`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.transportMode has an unknown property 'notAnOption'. These properties are valid: | ||
object { client?, server? }" | ||
`; | ||
|
||
exports[`options validation transportMode 4`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.transportMode should be one of these: | ||
object { client?, server? } | \\"sockjs\\" | \\"ws\\" | ||
Details: | ||
* configuration.transportMode.server should be one of these: | ||
string | function | ||
Details: | ||
* configuration.transportMode.server should be a string. | ||
* configuration.transportMode.server should be an instance of function." | ||
`; | ||
|
||
exports[`options validation transportMode 5`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.transportMode.client should be a string." | ||
`; | ||
|
||
exports[`options validation watchFiles 1`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.watchFiles should be one of these: | ||
non-empty string | object { paths?, options? } | [non-empty string | object { paths?, options? }, ...] | ||
Details: | ||
* configuration.watchFiles should be a non-empty string. | ||
* configuration.watchFiles should be an object: | ||
object { paths?, options? } | ||
* configuration.watchFiles should be an array: | ||
[non-empty string | object { paths?, options? }, ...]" | ||
`; | ||
|
||
exports[`options validation watchFiles 2`] = ` | ||
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. | ||
- configuration.watchFiles should be one of these: | ||
non-empty string | object { paths?, options? } | [non-empty string | object { paths?, options? }, ...] | ||
Details: | ||
* configuration.watchFiles should be a non-empty string. | ||
* configuration.watchFiles should be an object: | ||
object { paths?, options? } | ||
* configuration.watchFiles should be an array: | ||
[non-empty string | object { paths?, options? }, ...]" | ||
`; |
Oops, something went wrong.