Skip to content

Commit a6eb1a4

Browse files
authored
test: update validation tests (#3113)
1 parent d2cb1e1 commit a6eb1a4

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

test/Validation.test.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,12 @@ describe('Validation', () => {
3030
config: { hot: 'false' },
3131
},
3232
{
33-
name: 'invalid `injectHot` configuration',
34-
config: { injectHot: 1 },
33+
name: 'invalid `needClientEntry` configuration',
34+
config: { client: { needClientEntry: 1 } },
35+
},
36+
{
37+
name: 'invalid `needHotEntry` configuration',
38+
config: { client: { needHotEntry: 1 } },
3539
},
3640
{
3741
name: 'invalid `static` configuration',

test/__snapshots__/Validation.test.js.snap

+15-3
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,22 @@ exports[`Validation validation should fail validation for invalid \`hot\` config
99
* configuration.hot should be \\"only\\"."
1010
`;
1111

12-
exports[`Validation validation should fail validation for invalid \`injectHot\` configuration 1`] = `
12+
exports[`Validation validation should fail validation for invalid \`needClientEntry\` configuration 1`] = `
1313
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
14-
- configuration has an unknown property 'injectHot'. These properties are valid:
15-
object { bonjour?, client?, compress?, dev?, firewall?, headers?, historyApiFallback?, host?, hot?, http2?, https?, liveReload?, onAfterSetupMiddleware?, onBeforeSetupMiddleware?, onListening?, open?, openPage?, port?, proxy?, public?, setupExitSignals?, static?, transportMode?, useLocalIp? }"
14+
- configuration.client.needClientEntry should be one of these:
15+
boolean | function
16+
Details:
17+
* configuration.client.needClientEntry should be a boolean.
18+
* configuration.client.needClientEntry should be an instance of function."
19+
`;
20+
21+
exports[`Validation validation should fail validation for invalid \`needHotEntry\` configuration 1`] = `
22+
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
23+
- configuration.client.needHotEntry should be one of these:
24+
boolean | function
25+
Details:
26+
* configuration.client.needHotEntry should be a boolean.
27+
* configuration.client.needHotEntry should be an instance of function."
1628
`;
1729

1830
exports[`Validation validation should fail validation for invalid \`static\` configuration 1`] = `

0 commit comments

Comments
 (0)