@@ -279,6 +279,108 @@ describe("Cli", () => {
279279 ` )
280280 ) ;
281281
282+ test (
283+ "numbers decimal and scientific notation strings" ,
284+ {
285+ "watch-options-aggregate-timeout" : ".25" ,
286+ "watch-options-poll" : "1e2" ,
287+ "output-chunk-load-timeout" : "5." ,
288+ parallelism : "1e+2" ,
289+ "performance-max-asset-size" : "1.5e3" ,
290+ "performance-max-entrypoint-size" : "2e-1" ,
291+ "stats-assets-space" : "10E+1" ,
292+ "stats-errors-space" : "+.5"
293+ } ,
294+ { } ,
295+ ( e ) =>
296+ e . toMatchInlineSnapshot ( `
297+ Object {
298+ "output": Object {
299+ "chunkLoadTimeout": 5,
300+ },
301+ "parallelism": 100,
302+ "performance": Object {
303+ "maxAssetSize": 1500,
304+ "maxEntrypointSize": 0.2,
305+ },
306+ "stats": Object {
307+ "assetsSpace": 100,
308+ "errorsSpace": 0.5,
309+ },
310+ "watchOptions": Object {
311+ "aggregateTimeout": 0.25,
312+ "poll": 100,
313+ },
314+ }
315+ ` )
316+ ) ;
317+
318+ test (
319+ "invalid number strings (decimal and exponent edge cases)" ,
320+ {
321+ parallelism : "1e" ,
322+ "performance-max-asset-size" : "e10" ,
323+ "performance-max-entrypoint-size" : "1e2.5" ,
324+ "stats-assets-space" : "1.2.3" ,
325+ "output-chunk-load-timeout" : "7e-" ,
326+ "stats-warnings-space" : "++1"
327+ } ,
328+ { } ,
329+ ( e ) =>
330+ e . toMatchInlineSnapshot ( `
331+ Array [
332+ Object {
333+ "argument": "parallelism",
334+ "expected": "number",
335+ "index": undefined,
336+ "path": "parallelism",
337+ "type": "invalid-value",
338+ "value": "1e",
339+ },
340+ Object {
341+ "argument": "performance-max-asset-size",
342+ "expected": "number",
343+ "index": undefined,
344+ "path": "performance.maxAssetSize",
345+ "type": "invalid-value",
346+ "value": "e10",
347+ },
348+ Object {
349+ "argument": "performance-max-entrypoint-size",
350+ "expected": "number",
351+ "index": undefined,
352+ "path": "performance.maxEntrypointSize",
353+ "type": "invalid-value",
354+ "value": "1e2.5",
355+ },
356+ Object {
357+ "argument": "stats-assets-space",
358+ "expected": "number",
359+ "index": undefined,
360+ "path": "stats.assetsSpace",
361+ "type": "invalid-value",
362+ "value": "1.2.3",
363+ },
364+ Object {
365+ "argument": "output-chunk-load-timeout",
366+ "expected": "number",
367+ "index": undefined,
368+ "path": "output.chunkLoadTimeout",
369+ "type": "invalid-value",
370+ "value": "7e-",
371+ },
372+ Object {
373+ "argument": "stats-warnings-space",
374+ "expected": "number",
375+ "index": undefined,
376+ "path": "stats.warningsSpace",
377+ "type": "invalid-value",
378+ "value": "++1",
379+ },
380+ ]
381+ ` )
382+ ) ;
383+
282384 test (
283385 "booleans and enums" ,
284386 {
@@ -323,6 +425,8 @@ describe("Cli", () => {
323425 "output-library-name" : "non-object" ,
324426 "resolve-loader-unsafe-cache" : [ true , false ] ,
325427 "output-chunk-load-timeout" : "20000x" ,
428+ "watch-options-aggregate-timeout" : "Infinity" ,
429+ "watch-options-poll" : "0x10" ,
326430 "cache-type" : "filsystem" ,
327431 "entry-reset" : false ,
328432 "module-unknown-context-reg-exp" : "ab?c*" ,
@@ -366,6 +470,30 @@ describe("Cli", () => {
366470 "type": "invalid-value",
367471 "value": "20000x",
368472 },
473+ Object {
474+ "argument": "watch-options-aggregate-timeout",
475+ "expected": "number",
476+ "index": undefined,
477+ "path": "watchOptions.aggregateTimeout",
478+ "type": "invalid-value",
479+ "value": "Infinity",
480+ },
481+ Object {
482+ "argument": "watch-options-poll",
483+ "expected": "number",
484+ "index": undefined,
485+ "path": "watchOptions.poll",
486+ "type": "invalid-value",
487+ "value": "0x10",
488+ },
489+ Object {
490+ "argument": "watch-options-poll",
491+ "expected": "true | false",
492+ "index": undefined,
493+ "path": "watchOptions.poll",
494+ "type": "invalid-value",
495+ "value": "0x10",
496+ },
369497 Object {
370498 "argument": "cache-type",
371499 "expected": "memory",
0 commit comments