From 0988be239d48efe4a904958d6f86c010f9050b0a Mon Sep 17 00:00:00 2001 From: Evilebot Tnawi Date: Thu, 26 Sep 2019 20:03:29 +0300 Subject: [PATCH] feat: better errors when the `type` keyword doesn't exist --- src/ValidationError.js | 124 ++++++-- test/__snapshots__/index.test.js.snap | 343 +++++++++++++++++--- test/fixtures/schema.json | 196 ++++++++++++ test/index.test.js | 436 ++++++++++++++++++++++++++ 4 files changed, 1018 insertions(+), 81 deletions(-) diff --git a/src/ValidationError.js b/src/ValidationError.js index 01fb876..d83137f 100644 --- a/src/ValidationError.js +++ b/src/ValidationError.js @@ -223,6 +223,28 @@ function getArticle(type) { return 'a'; } +function getSchemaNonTypes(schema) { + if (!schema.type) { + if (likeNumber(schema) || likeInteger(schema)) { + return ' | should be any non-number'; + } + + if (likeString(schema)) { + return ' | should be any non-string'; + } + + if (likeArray(schema)) { + return ' | should be any non-array'; + } + + if (likeObject(schema)) { + return ' | should be any non-object'; + } + } + + return ''; +} + class ValidationError extends Error { constructor(errors, schema, configuration = {}) { super(); @@ -280,12 +302,18 @@ class ValidationError extends Error { return `non ${formatInnerSchema(schema.not)}`; } - // eslint-disable-next-line default-case - switch (schema.instanceof) { - case 'Function': - return 'function'; - case 'RegExp': - return 'RegExp'; + if (schema.instanceof) { + if (Array.isArray(schema.instanceof)) { + return schema.instanceof.map(formatInnerSchema).join(' | '); + } + + // eslint-disable-next-line default-case + switch (schema.instanceof) { + case 'Function': + return 'function'; + case 'RegExp': + return 'RegExp'; + } } if (schema.enum) { @@ -687,93 +715,119 @@ class ValidationError extends Error { case 'pattern': return `${dataPath} should match pattern ${JSON.stringify( error.params.pattern + )}${getSchemaNonTypes( + error.parentSchema )}.${this.getSchemaPartDescription(error.parentSchema)}`; case 'format': return `${dataPath} should match format ${JSON.stringify( error.params.format + )}${getSchemaNonTypes( + error.parentSchema )}.${this.getSchemaPartDescription(error.parentSchema)}`; case 'formatMinimum': case 'formatMaximum': return `${dataPath} should be ${ error.params.comparison - } ${JSON.stringify(error.params.limit)}.${this.getSchemaPartDescription( + } ${JSON.stringify(error.params.limit)}${getSchemaNonTypes( error.parentSchema - )}`; + )}.${this.getSchemaPartDescription(error.parentSchema)}`; case 'minimum': case 'maximum': case 'exclusiveMinimum': case 'exclusiveMaximum': return `${dataPath} should be ${error.params.comparison} ${ error.params.limit - }.${this.getSchemaPartDescription(error.parentSchema)}`; + }${getSchemaNonTypes( + error.parentSchema + )}.${this.getSchemaPartDescription(error.parentSchema)}`; case 'multipleOf': return `${dataPath} should be multiple of ${ error.params.multipleOf - }.${this.getSchemaPartDescription(error.parentSchema)}`; + }${getSchemaNonTypes( + error.parentSchema + )}.${this.getSchemaPartDescription(error.parentSchema)}`; case 'patternRequired': return `${dataPath} should have property matching pattern ${JSON.stringify( error.params.missingPattern + )}${getSchemaNonTypes( + error.parentSchema )}.${this.getSchemaPartDescription(error.parentSchema)}`; case 'minLength': { if (error.params.limit === 1) { - return `${dataPath} should be an non-empty string.${this.getSchemaPartDescription( + return `${dataPath} should be an non-empty string${getSchemaNonTypes( error.parentSchema - )}`; + )}.${this.getSchemaPartDescription(error.parentSchema)}`; } return `${dataPath} should not be shorter than ${ error.params.limit - } characters.${this.getSchemaPartDescription(error.parentSchema)}`; + } characters${getSchemaNonTypes( + error.parentSchema + )}.${this.getSchemaPartDescription(error.parentSchema)}`; } case 'minItems': { if (error.params.limit === 1) { - return `${dataPath} should be an non-empty array.${this.getSchemaPartDescription( + return `${dataPath} should be an non-empty array${getSchemaNonTypes( error.parentSchema - )}`; + )}.${this.getSchemaPartDescription(error.parentSchema)}`; } return `${dataPath} should not have fewer than ${ error.params.limit - } items.${this.getSchemaPartDescription(error.parentSchema)}`; + } items${getSchemaNonTypes( + error.parentSchema + )}.${this.getSchemaPartDescription(error.parentSchema)}`; } case 'minProperties': { if (error.params.limit === 1) { - return `${dataPath} should be an non-empty object.${this.getSchemaPartDescription( + return `${dataPath} should be an non-empty object${getSchemaNonTypes( error.parentSchema - )}`; + )}.${this.getSchemaPartDescription(error.parentSchema)}`; } return `${dataPath} should not have fewer than ${ error.params.limit - } properties.${this.getSchemaPartDescription(error.parentSchema)}`; + } properties${getSchemaNonTypes( + error.parentSchema + )}.${this.getSchemaPartDescription(error.parentSchema)}`; } case 'maxLength': return `${dataPath} should not be longer than ${ error.params.limit - } characters.${this.getSchemaPartDescription(error.parentSchema)}`; + } characters${getSchemaNonTypes( + error.parentSchema + )}.${this.getSchemaPartDescription(error.parentSchema)}`; case 'maxItems': return `${dataPath} should not have more than ${ error.params.limit - } items.${this.getSchemaPartDescription(error.parentSchema)}`; + } items${getSchemaNonTypes( + error.parentSchema + )}.${this.getSchemaPartDescription(error.parentSchema)}`; case 'maxProperties': return `${dataPath} should not have more than ${ error.params.limit - } properties.${this.getSchemaPartDescription(error.parentSchema)}`; + } properties${getSchemaNonTypes( + error.parentSchema + )}.${this.getSchemaPartDescription(error.parentSchema)}`; case 'uniqueItems': return `${dataPath} should not contain the item '${ error.data[error.params.i] - }' twice.${this.getSchemaPartDescription(error.parentSchema)}`; + }' twice${getSchemaNonTypes( + error.parentSchema + )}.${this.getSchemaPartDescription(error.parentSchema)}`; case 'additionalItems': return `${dataPath} should not have more than ${ error.params.limit - } items. These items are valid:\n${this.getSchemaPartText( + } items${getSchemaNonTypes( + error.parentSchema + )}. These items are valid:\n${this.getSchemaPartText( error.parentSchema )}`; case 'contains': return `${dataPath} should contains at least one ${this.getSchemaPartText( error.parentSchema, ['contains'] - )} item.`; + )} item${getSchemaNonTypes(error.parentSchema)}.`; case 'required': { const missingProperty = error.params.missingProperty.replace(/^\./, ''); const hasProperty = Boolean( @@ -781,7 +835,9 @@ class ValidationError extends Error { error.parentSchema.properties[missingProperty] ); - return `${dataPath} misses the property '${missingProperty}'.${ + return `${dataPath} misses the property '${missingProperty}'${getSchemaNonTypes( + error.parentSchema + )}.${ hasProperty ? ` Should be:\n${this.getSchemaPartText(error.parentSchema, [ 'properties', @@ -793,7 +849,9 @@ class ValidationError extends Error { case 'additionalProperties': return `${dataPath} has an unknown property '${ error.params.additionalProperty - }'. These properties are valid:\n${this.getSchemaPartText( + }'${getSchemaNonTypes( + error.parentSchema + )}. These properties are valid:\n${this.getSchemaPartText( error.parentSchema )}`; case 'dependencies': { @@ -804,12 +862,16 @@ class ValidationError extends Error { return `${dataPath} should have properties ${dependencies} when property '${ error.params.property - }' is present.${this.getSchemaPartDescription(error.parentSchema)}`; + }' is present${getSchemaNonTypes( + error.parentSchema + )}.${this.getSchemaPartDescription(error.parentSchema)}`; } case 'propertyNames': { - const invalidProperty = error.params.propertyName; - - return `${dataPath} property name '${invalidProperty}' is invalid. Property names should be match format ${JSON.stringify( + return `${dataPath} property name '${ + error.params.propertyName + }' is invalid${getSchemaNonTypes( + error.parentSchema + )}. Property names should be match format ${JSON.stringify( error.schema.format )}.${this.getSchemaPartDescription(error.parentSchema)}`; } diff --git a/test/__snapshots__/index.test.js.snap b/test/__snapshots__/index.test.js.snap index 89b8de8..455f4a5 100644 --- a/test/__snapshots__/index.test.js.snap +++ b/test/__snapshots__/index.test.js.snap @@ -35,7 +35,7 @@ exports[`Validation should fail validation for absolute path 1`] = ` exports[`Validation should fail validation for additional key on root 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - configuration has an unknown property 'postcss'. These properties are valid: - object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, externals?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, serve?, stats?, target?, watch?, watchOptions?, minLengthOne?, minLengthTwo?, integerType?, nullType?, allOfRef?, customObject?, objectType?, anyOfKeyword?, nestedArrayWithoutItems?, nestedObjectWithoutItems?, arrayType?, arrayType2?, multipleTypes?, zeroMaxItems?, multipleContains?, multipleContains2?, exclusiveMinimumKeyword?, exclusiveMaximumKeyword?, uniqueItemsKeyword?, minPropertiesKeyword?, maxPropertiesKeyword?, requiredKeyword?, requiredKeywordWithAdditionalProperties?, enumKeyword?, formatMinimumKeyword?, formatMaximumKeyword?, formatExclusiveMinimumKeyword?, formatExclusiveMaximumKeyword?, formatMinMaxExclusiveMinKeyword?, formatMinMaxExclusiveMaxKeyword?, minItemsKeyword?, maxItemsKeyword?, itemsKeyword?, itemsKeyword2?, additionalItemsKeyword?, additionalItemsKeyword2?, additionalItemsKeyword3?, additionalItemsKeyword4?, propertiesKeyword?, patternPropertiesKeyword?, patternPropertiesKeyword2?, arrayWithOnlyNumber?, onlyRequired?, dependenciesKeyword?, dependenciesKeyword2?, patternRequiredKeyword?, patternRequiredKeyword2?, onlyProperties?, onlyProperties2?, onlyItems?, onlyItems2?, onlyAdditionalItems?, booleanType?, additionalPropertiesKeyword?, additionalPropertiesKeyword2?, propertyNamesKeyword?, constKeyword?, constKeyword2?, ifThenElseKeyword?, ifThenElseKeyword2?, stringKeyword?, arrayKeyword?, arrayKeyword2?, arrayKeyword3?, arrayKeyword4?, arrayKeyword5?, arrayKeyword6?, arrayKeyword7?, arrayKeyword8?, arrayKeyword9?, arrayKeyword10?, arrayKeyword11?, arrayKeyword12?, arrayKeyword13?, arrayKeyword14?, arrayKeyword15?, arrayKeyword16?, arrayKeyword17?, arrayKeyword18?, arrayKeyword19?, recursion?, extending?, longString?, integerWithMinimum?, integerWithExclusiveMinimum?, integerWithExclusiveMaximum?, numberWithMinimum?, multipleOfProp?, stringWithMinAndMaxLength?, strictFormat?, strictFormat2?, uniqueItemsProp?, numberAndDescription?, oneOfnumberAndDescriptionAndArray?, maxPropertiesAndMinProperties?, objectTest?, objectTest2?, objectTest3?, objectTest4?, objectTest5?, objectTest6?, objectTest7?, objectTest8?, objectTest9?, stringWithEmptyPattern?, likeArray?, arrayWithEmptyItemsAndEmptyAdditionalItemsAndEmptyContains?, numberWithoutType?, numberWithoutType2?, stringWithoutType?, arrayWithoutType?, additionalItemsFalse?, requiredWithoutType?, dependenciesWithoutType?, propertyNamesWithoutType?, patternRequiredWithoutType?, additionalPropertiesWithoutType?, maxPropertiesWithoutType?, justAnObject?, arrayWithAbsolutePath?, allOfKeyword?, enumWithDescription?, constWithDescription?, itemsTrue?, emptyConst?, oneConst?, constWithEmptyString?, refAndAnyOf?, additionalPropertiesInsideOneOf?, additionalPropertiesInsideOneOf2?, singleContainsItems?, objectWithPropertyDependency?, objectWithPropertyDependency2?, objectWithPropertyDependency3?, objectWithPropertyDependency4?, oneOfWithIf?, constWithArrayNotation?, constWithObjectNotation?, additionalItemsWithoutType?, additionalItemsWithoutType2?, additionalItemsWithoutType3?, containsAndAdditionalItems?, containsInsideItem?, emptyObject?, nonEmptyObject?, nonEmptyObject2?, notEnum?, notConst?, notNumber?, notInteger?, notString?, notBoolean?, notArray?, notObject?, notNull?, notNotNull?, NotNotNotNull?, notMultipleTypes?, notMaxItemsArray? }" + object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, externals?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, serve?, stats?, target?, watch?, watchOptions?, minLengthOne?, minLengthTwo?, integerType?, nullType?, allOfRef?, customObject?, objectType?, anyOfKeyword?, nestedArrayWithoutItems?, nestedObjectWithoutItems?, arrayType?, arrayType2?, multipleTypes?, zeroMaxItems?, multipleContains?, multipleContains2?, exclusiveMinimumKeyword?, exclusiveMaximumKeyword?, uniqueItemsKeyword?, minPropertiesKeyword?, maxPropertiesKeyword?, requiredKeyword?, requiredKeywordWithAdditionalProperties?, enumKeyword?, formatMinimumKeyword?, formatMaximumKeyword?, formatExclusiveMinimumKeyword?, formatExclusiveMaximumKeyword?, formatMinMaxExclusiveMinKeyword?, formatMinMaxExclusiveMaxKeyword?, minItemsKeyword?, maxItemsKeyword?, itemsKeyword?, itemsKeyword2?, additionalItemsKeyword?, additionalItemsKeyword2?, additionalItemsKeyword3?, additionalItemsKeyword4?, propertiesKeyword?, patternPropertiesKeyword?, patternPropertiesKeyword2?, arrayWithOnlyNumber?, onlyRequired?, dependenciesKeyword?, dependenciesKeyword2?, patternRequiredKeyword?, patternRequiredKeyword2?, onlyProperties?, onlyProperties2?, onlyItems?, onlyItems2?, onlyAdditionalItems?, booleanType?, additionalPropertiesKeyword?, additionalPropertiesKeyword2?, propertyNamesKeyword?, constKeyword?, constKeyword2?, ifThenElseKeyword?, ifThenElseKeyword2?, stringKeyword?, arrayKeyword?, arrayKeyword2?, arrayKeyword3?, arrayKeyword4?, arrayKeyword5?, arrayKeyword6?, arrayKeyword7?, arrayKeyword8?, arrayKeyword9?, arrayKeyword10?, arrayKeyword11?, arrayKeyword12?, arrayKeyword13?, arrayKeyword14?, arrayKeyword15?, arrayKeyword16?, arrayKeyword17?, arrayKeyword18?, arrayKeyword19?, recursion?, extending?, longString?, integerWithMinimum?, integerWithExclusiveMinimum?, integerWithExclusiveMaximum?, numberWithMinimum?, multipleOfProp?, stringWithMinAndMaxLength?, strictFormat?, strictFormat2?, uniqueItemsProp?, numberAndDescription?, oneOfnumberAndDescriptionAndArray?, maxPropertiesAndMinProperties?, objectTest?, objectTest2?, objectTest3?, objectTest4?, objectTest5?, objectTest6?, objectTest7?, objectTest8?, objectTest9?, stringWithEmptyPattern?, likeArray?, arrayWithEmptyItemsAndEmptyAdditionalItemsAndEmptyContains?, numberWithoutType?, numberWithoutType2?, stringWithoutType?, arrayWithoutType?, additionalItemsFalse?, requiredWithoutType?, dependenciesWithoutType?, propertyNamesWithoutType?, patternRequiredWithoutType?, additionalPropertiesWithoutType?, maxPropertiesWithoutType?, justAnObject?, arrayWithAbsolutePath?, allOfKeyword?, enumWithDescription?, constWithDescription?, itemsTrue?, emptyConst?, oneConst?, constWithEmptyString?, refAndAnyOf?, additionalPropertiesInsideOneOf?, additionalPropertiesInsideOneOf2?, singleContainsItems?, objectWithPropertyDependency?, objectWithPropertyDependency2?, objectWithPropertyDependency3?, objectWithPropertyDependency4?, oneOfWithIf?, constWithArrayNotation?, constWithObjectNotation?, additionalItemsWithoutType?, additionalItemsWithoutType2?, additionalItemsWithoutType3?, containsAndAdditionalItems?, containsInsideItem?, emptyObject?, nonEmptyObject?, nonEmptyObject2?, notEnum?, notConst?, notNumber?, notInteger?, notString?, notBoolean?, notArray?, notObject?, notNull?, notNotNull?, NotNotNotNull?, notMultipleTypes?, notMaxItemsArray?, noTypeLikeNumberMinimum?, noTypeLikeNumberMaximum?, noTypeLikeNumberExclusiveMinimum?, noTypeLikeNumberExclusiveMaximum?, minimumWithTypeNumber?, maximumWithTypeNumber?, exclusiveMinimumWithTypeNumber?, exclusiveMaximumWithTypeNumber?, noTypeLikeNumberMultipleOf?, multipleOfWithNumberType?, noTypeLikeStringMinLength?, noTypeLikeStringMaxLength?, stringWithMinLength?, stringWithMaxLength?, noTypeLikeStringPattern?, patternWithStringType?, noTypeLikeStringFormat?, stringWithFormat?, noTypeLikeStringFormatMaximum?, stringWithFormatMaximum?, multipleInstanceof?, noTypeLikeObjectPatternRequired?, objectWithPatternRequired?, noTypeLikeStringMinLength1?, noTypeLikeArrayMinItems?, noTypeLikeArrayMinItems1?, arrayWithMinItems?, noTypeMinProperties?, noTypeMinProperties1?, objectMinProperties?, noTypeLikeArrayMaxItems?, arrayMaxItems?, noTypeLikeObjectMaxProperties?, objectMaxProperties?, noTypeLikeArrayUniqueItems?, arrayWithUniqueItems?, noTypeLikeArrayAdditionalItems?, arrayWithAdditionalItems?, noTypeLikeArrayContains?, arrayWithContains?, anyOfNoTypeInItem?, oneOfNoTypeInItem?, noTypeLikeObjectPropertyNames?, objectPropertyNames?, noTypeLikeObjectDependencies?, objectWithDependencies?, noTypeLikeObjectAdditionalProperties?, noTypeLikeObjectRequired? }" `; exports[`Validation should fail validation for additionalItems #2 1`] = ` @@ -61,19 +61,19 @@ exports[`Validation should fail validation for additionalItems 1`] = ` exports[`Validation should fail validation for additionalItems with false 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.additionalItemsFalse should not have more than 2 items. These items are valid: + - configuration.additionalItemsFalse should not have more than 2 items | should be any non-array. These items are valid: [integer, integer]" `; exports[`Validation should fail validation for additionalProperties #2 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.additionalPropertiesKeyword has an unknown property 'baz'. These properties are valid: + - configuration.additionalPropertiesKeyword has an unknown property 'baz' | should be any non-object. These properties are valid: object { foo? } (additional property names should match pattern \\"^.*r$\\")" `; exports[`Validation should fail validation for additionalProperties #3 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.additionalPropertiesKeyword has an unknown property 'baz'. These properties are valid: + - configuration.additionalPropertiesKeyword has an unknown property 'baz' | should be any non-object. These properties are valid: object { foo? } (additional property names should match pattern \\"^.*r$\\") - configuration.additionalPropertiesKeyword.foo should be a number." `; @@ -95,7 +95,7 @@ exports[`Validation should fail validation for additionalProperties #6 1`] = ` exports[`Validation should fail validation for additionalProperties 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.additionalPropertiesKeyword has an unknown property 'a'. These properties are valid: + - configuration.additionalPropertiesKeyword has an unknown property 'a' | should be any non-object. These properties are valid: object { foo? } (additional property names should match pattern \\"^.*r$\\")" `; @@ -127,7 +127,7 @@ exports[`Validation should fail validation for additionalProperties inside oneOf exports[`Validation should fail validation for additionalProperties without object type 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.additionalPropertiesWithoutType has an unknown property 'boo'. These properties are valid: + - configuration.additionalPropertiesWithoutType has an unknown property 'boo' | should be any non-object. These properties are valid: object {}" `; @@ -138,7 +138,7 @@ exports[`Validation should fail validation for allOf #1 1`] = ` exports[`Validation should fail validation for allOf #2 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.allOfKeyword should be <= 3." + - configuration.allOfKeyword should be <= 3 | should be any non-number." `; exports[`Validation should fail validation for allOf 1`] = ` @@ -173,6 +173,11 @@ exports[`Validation should fail validation for anyOf 1`] = ` -> A non-empty array of non-empty strings" `; +exports[`Validation should fail validation for anyOf with item without type 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.anyOfNoTypeInItem should be <= 3 | should be any non-number." +`; + exports[`Validation should fail validation for array #1 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - configuration.arrayKeyword[0] should be a integer." @@ -206,12 +211,12 @@ exports[`Validation should fail validation for array #5 1`] = ` exports[`Validation should fail validation for array #5 2`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.arrayKeyword3 should not contain the item '1' twice." + - configuration.arrayKeyword3 should not contain the item '1' twice | should be any non-array." `; exports[`Validation should fail validation for array #6 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.arrayKeyword3 should not have more than 3 items." + - configuration.arrayKeyword3 should not have more than 3 items | should be any non-array." `; exports[`Validation should fail validation for array #7 1`] = ` @@ -355,6 +360,17 @@ exports[`Validation should fail validation for array with absolutePath item 1`] [integer, string, ...]" `; +exports[`Validation should fail validation for array with additionalItems 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.arrayWithAdditionalItems should not have more than 2 items. These items are valid: + [integer, integer]" +`; + +exports[`Validation should fail validation for array with contains 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.arrayWithContains should contains at least one integer item." +`; + exports[`Validation should fail validation for array with empty items, empty additionalItems, empty contains 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - configuration.arrayWithEmptyItemsAndEmptyAdditionalItemsAndEmptyContains should be an array: @@ -367,6 +383,16 @@ exports[`Validation should fail validation for array with items with true 1`] = [any, ...]" `; +exports[`Validation should fail validation for array with maxItems 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.arrayMaxItems should not have more than 2 items." +`; + +exports[`Validation should fail validation for array with minItems 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.arrayWithMinItems should be an non-empty array." +`; + exports[`Validation should fail validation for array with only number 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - configuration.arrayWithOnlyNumber[0] should be a number." @@ -468,7 +494,7 @@ exports[`Validation should fail validation for contains #1 1`] = ` exports[`Validation should fail validation for contains 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.customObject.containsKeyword should contains at least one integer item." + - configuration.customObject.containsKeyword should contains at least one integer item | should be any non-array." `; exports[`Validation should fail validation for contains and additionalItems #2 1`] = ` @@ -484,7 +510,7 @@ exports[`Validation should fail validation for contains and additionalItems 1`] exports[`Validation should fail validation for contains inside items #2 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.containsInsideItem[0] should contains at least one integer item." + - configuration.containsInsideItem[0] should contains at least one integer item | should be any non-array." `; exports[`Validation should fail validation for contains inside items 1`] = ` @@ -513,12 +539,12 @@ exports[`Validation should fail validation for dependencies #2 1`] = ` exports[`Validation should fail validation for dependencies 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.dependenciesKeyword should have properties 'bar', 'baz' when property 'foo' is present." + - configuration.dependenciesKeyword should have properties 'bar', 'baz' when property 'foo' is present | should be any non-object." `; exports[`Validation should fail validation for dependencies without object type 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.dependenciesWithoutType should have properties 'bar', 'baz' when property 'foo' is present." + - configuration.dependenciesWithoutType should have properties 'bar', 'baz' when property 'foo' is present | should be any non-object." `; exports[`Validation should fail validation for empty const 1`] = ` @@ -566,6 +592,16 @@ exports[`Validation should fail validation for enum 2`] = ` 2 | \\"foo\\" | {\\"foo\\":\\"bar\\"} | [1,2,3]" `; +exports[`Validation should fail validation for exclusive maximum with type number 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.exclusiveMaximumWithTypeNumber should be <= 5." +`; + +exports[`Validation should fail validation for exclusive minimum with type number 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.exclusiveMinimumWithTypeNumber should be >= 5." +`; + exports[`Validation should fail validation for exclusiveMaximum 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - configuration.exclusiveMaximumKeyword should be < 5." @@ -578,23 +614,28 @@ exports[`Validation should fail validation for exclusiveMinimum 1`] = ` exports[`Validation should fail validation for extending 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.extending.shipping_address misses the property 'type'. Should be: + - configuration.extending.shipping_address misses the property 'type' | should be any non-object. Should be: \\"residential\\" | \\"business\\"" `; exports[`Validation should fail validation for format 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.customObject.formatKeyword should match format \\"ipv4\\"." + - configuration.customObject.formatKeyword should match format \\"ipv4\\" | should be any non-string." `; exports[`Validation should fail validation for format and formatMinimum and formatMaximum and formatExclusiveMaximum 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.formatMinMaxExclusiveMinKeyword should be > \\"2016-02-06\\"." + - configuration.formatMinMaxExclusiveMinKeyword should be > \\"2016-02-06\\" | should be any non-string." `; exports[`Validation should fail validation for format and formatMinimum and formatMaximum and formatExclusiveMaximum 2`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.formatMinMaxExclusiveMaxKeyword should be >= \\"2016-02-06\\"." + - configuration.formatMinMaxExclusiveMaxKeyword should be >= \\"2016-02-06\\" | should be any non-string." +`; + +exports[`Validation should fail validation for format with type string 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.stringWithFormat should match format \\"date\\"." `; exports[`Validation should fail validation for format, formatMaximum and formatExclusiveMaximum #2 1`] = ` @@ -619,28 +660,33 @@ exports[`Validation should fail validation for format, formatMinimum and formatE exports[`Validation should fail validation for formatExclusiveMaximum 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.formatExclusiveMaximumKeyword should be < \\"2016-02-06\\"." + - configuration.formatExclusiveMaximumKeyword should be < \\"2016-02-06\\" | should be any non-string." `; exports[`Validation should fail validation for formatExclusiveMinimum 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.formatExclusiveMinimumKeyword should be > \\"2016-02-06\\"." + - configuration.formatExclusiveMinimumKeyword should be > \\"2016-02-06\\" | should be any non-string." `; exports[`Validation should fail validation for formatMaximum 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.formatMaximumKeyword should be <= \\"2016-02-06\\"." + - configuration.formatMaximumKeyword should be <= \\"2016-02-06\\" | should be any non-string." +`; + +exports[`Validation should fail validation for formatMaximum with type string 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.stringWithFormatMaximum should be < \\"2016-02-06\\"." `; exports[`Validation should fail validation for formatMinimum 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.formatMinimumKeyword should be >= \\"2016-02-06\\"." + - configuration.formatMinimumKeyword should be >= \\"2016-02-06\\" | should be any non-string." `; exports[`Validation should fail validation for holey array 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - configuration[1] should be an object: - object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, externals?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, serve?, stats?, target?, watch?, watchOptions?, minLengthOne?, minLengthTwo?, integerType?, nullType?, allOfRef?, customObject?, objectType?, anyOfKeyword?, nestedArrayWithoutItems?, nestedObjectWithoutItems?, arrayType?, arrayType2?, multipleTypes?, zeroMaxItems?, multipleContains?, multipleContains2?, exclusiveMinimumKeyword?, exclusiveMaximumKeyword?, uniqueItemsKeyword?, minPropertiesKeyword?, maxPropertiesKeyword?, requiredKeyword?, requiredKeywordWithAdditionalProperties?, enumKeyword?, formatMinimumKeyword?, formatMaximumKeyword?, formatExclusiveMinimumKeyword?, formatExclusiveMaximumKeyword?, formatMinMaxExclusiveMinKeyword?, formatMinMaxExclusiveMaxKeyword?, minItemsKeyword?, maxItemsKeyword?, itemsKeyword?, itemsKeyword2?, additionalItemsKeyword?, additionalItemsKeyword2?, additionalItemsKeyword3?, additionalItemsKeyword4?, propertiesKeyword?, patternPropertiesKeyword?, patternPropertiesKeyword2?, arrayWithOnlyNumber?, onlyRequired?, dependenciesKeyword?, dependenciesKeyword2?, patternRequiredKeyword?, patternRequiredKeyword2?, onlyProperties?, onlyProperties2?, onlyItems?, onlyItems2?, onlyAdditionalItems?, booleanType?, additionalPropertiesKeyword?, additionalPropertiesKeyword2?, propertyNamesKeyword?, constKeyword?, constKeyword2?, ifThenElseKeyword?, ifThenElseKeyword2?, stringKeyword?, arrayKeyword?, arrayKeyword2?, arrayKeyword3?, arrayKeyword4?, arrayKeyword5?, arrayKeyword6?, arrayKeyword7?, arrayKeyword8?, arrayKeyword9?, arrayKeyword10?, arrayKeyword11?, arrayKeyword12?, arrayKeyword13?, arrayKeyword14?, arrayKeyword15?, arrayKeyword16?, arrayKeyword17?, arrayKeyword18?, arrayKeyword19?, recursion?, extending?, longString?, integerWithMinimum?, integerWithExclusiveMinimum?, integerWithExclusiveMaximum?, numberWithMinimum?, multipleOfProp?, stringWithMinAndMaxLength?, strictFormat?, strictFormat2?, uniqueItemsProp?, numberAndDescription?, oneOfnumberAndDescriptionAndArray?, maxPropertiesAndMinProperties?, objectTest?, objectTest2?, objectTest3?, objectTest4?, objectTest5?, objectTest6?, objectTest7?, objectTest8?, objectTest9?, stringWithEmptyPattern?, likeArray?, arrayWithEmptyItemsAndEmptyAdditionalItemsAndEmptyContains?, numberWithoutType?, numberWithoutType2?, stringWithoutType?, arrayWithoutType?, additionalItemsFalse?, requiredWithoutType?, dependenciesWithoutType?, propertyNamesWithoutType?, patternRequiredWithoutType?, additionalPropertiesWithoutType?, maxPropertiesWithoutType?, justAnObject?, arrayWithAbsolutePath?, allOfKeyword?, enumWithDescription?, constWithDescription?, itemsTrue?, emptyConst?, oneConst?, constWithEmptyString?, refAndAnyOf?, additionalPropertiesInsideOneOf?, additionalPropertiesInsideOneOf2?, singleContainsItems?, objectWithPropertyDependency?, objectWithPropertyDependency2?, objectWithPropertyDependency3?, objectWithPropertyDependency4?, oneOfWithIf?, constWithArrayNotation?, constWithObjectNotation?, additionalItemsWithoutType?, additionalItemsWithoutType2?, additionalItemsWithoutType3?, containsAndAdditionalItems?, containsInsideItem?, emptyObject?, nonEmptyObject?, nonEmptyObject2?, notEnum?, notConst?, notNumber?, notInteger?, notString?, notBoolean?, notArray?, notObject?, notNull?, notNotNull?, NotNotNotNull?, notMultipleTypes?, notMaxItemsArray? }" + object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, externals?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, serve?, stats?, target?, watch?, watchOptions?, minLengthOne?, minLengthTwo?, integerType?, nullType?, allOfRef?, customObject?, objectType?, anyOfKeyword?, nestedArrayWithoutItems?, nestedObjectWithoutItems?, arrayType?, arrayType2?, multipleTypes?, zeroMaxItems?, multipleContains?, multipleContains2?, exclusiveMinimumKeyword?, exclusiveMaximumKeyword?, uniqueItemsKeyword?, minPropertiesKeyword?, maxPropertiesKeyword?, requiredKeyword?, requiredKeywordWithAdditionalProperties?, enumKeyword?, formatMinimumKeyword?, formatMaximumKeyword?, formatExclusiveMinimumKeyword?, formatExclusiveMaximumKeyword?, formatMinMaxExclusiveMinKeyword?, formatMinMaxExclusiveMaxKeyword?, minItemsKeyword?, maxItemsKeyword?, itemsKeyword?, itemsKeyword2?, additionalItemsKeyword?, additionalItemsKeyword2?, additionalItemsKeyword3?, additionalItemsKeyword4?, propertiesKeyword?, patternPropertiesKeyword?, patternPropertiesKeyword2?, arrayWithOnlyNumber?, onlyRequired?, dependenciesKeyword?, dependenciesKeyword2?, patternRequiredKeyword?, patternRequiredKeyword2?, onlyProperties?, onlyProperties2?, onlyItems?, onlyItems2?, onlyAdditionalItems?, booleanType?, additionalPropertiesKeyword?, additionalPropertiesKeyword2?, propertyNamesKeyword?, constKeyword?, constKeyword2?, ifThenElseKeyword?, ifThenElseKeyword2?, stringKeyword?, arrayKeyword?, arrayKeyword2?, arrayKeyword3?, arrayKeyword4?, arrayKeyword5?, arrayKeyword6?, arrayKeyword7?, arrayKeyword8?, arrayKeyword9?, arrayKeyword10?, arrayKeyword11?, arrayKeyword12?, arrayKeyword13?, arrayKeyword14?, arrayKeyword15?, arrayKeyword16?, arrayKeyword17?, arrayKeyword18?, arrayKeyword19?, recursion?, extending?, longString?, integerWithMinimum?, integerWithExclusiveMinimum?, integerWithExclusiveMaximum?, numberWithMinimum?, multipleOfProp?, stringWithMinAndMaxLength?, strictFormat?, strictFormat2?, uniqueItemsProp?, numberAndDescription?, oneOfnumberAndDescriptionAndArray?, maxPropertiesAndMinProperties?, objectTest?, objectTest2?, objectTest3?, objectTest4?, objectTest5?, objectTest6?, objectTest7?, objectTest8?, objectTest9?, stringWithEmptyPattern?, likeArray?, arrayWithEmptyItemsAndEmptyAdditionalItemsAndEmptyContains?, numberWithoutType?, numberWithoutType2?, stringWithoutType?, arrayWithoutType?, additionalItemsFalse?, requiredWithoutType?, dependenciesWithoutType?, propertyNamesWithoutType?, patternRequiredWithoutType?, additionalPropertiesWithoutType?, maxPropertiesWithoutType?, justAnObject?, arrayWithAbsolutePath?, allOfKeyword?, enumWithDescription?, constWithDescription?, itemsTrue?, emptyConst?, oneConst?, constWithEmptyString?, refAndAnyOf?, additionalPropertiesInsideOneOf?, additionalPropertiesInsideOneOf2?, singleContainsItems?, objectWithPropertyDependency?, objectWithPropertyDependency2?, objectWithPropertyDependency3?, objectWithPropertyDependency4?, oneOfWithIf?, constWithArrayNotation?, constWithObjectNotation?, additionalItemsWithoutType?, additionalItemsWithoutType2?, additionalItemsWithoutType3?, containsAndAdditionalItems?, containsInsideItem?, emptyObject?, nonEmptyObject?, nonEmptyObject2?, notEnum?, notConst?, notNumber?, notInteger?, notString?, notBoolean?, notArray?, notObject?, notNull?, notNotNull?, NotNotNotNull?, notMultipleTypes?, notMaxItemsArray?, noTypeLikeNumberMinimum?, noTypeLikeNumberMaximum?, noTypeLikeNumberExclusiveMinimum?, noTypeLikeNumberExclusiveMaximum?, minimumWithTypeNumber?, maximumWithTypeNumber?, exclusiveMinimumWithTypeNumber?, exclusiveMaximumWithTypeNumber?, noTypeLikeNumberMultipleOf?, multipleOfWithNumberType?, noTypeLikeStringMinLength?, noTypeLikeStringMaxLength?, stringWithMinLength?, stringWithMaxLength?, noTypeLikeStringPattern?, patternWithStringType?, noTypeLikeStringFormat?, stringWithFormat?, noTypeLikeStringFormatMaximum?, stringWithFormatMaximum?, multipleInstanceof?, noTypeLikeObjectPatternRequired?, objectWithPatternRequired?, noTypeLikeStringMinLength1?, noTypeLikeArrayMinItems?, noTypeLikeArrayMinItems1?, arrayWithMinItems?, noTypeMinProperties?, noTypeMinProperties1?, objectMinProperties?, noTypeLikeArrayMaxItems?, arrayMaxItems?, noTypeLikeObjectMaxProperties?, objectMaxProperties?, noTypeLikeArrayUniqueItems?, arrayWithUniqueItems?, noTypeLikeArrayAdditionalItems?, arrayWithAdditionalItems?, noTypeLikeArrayContains?, arrayWithContains?, anyOfNoTypeInItem?, oneOfNoTypeInItem?, noTypeLikeObjectPropertyNames?, objectPropertyNames?, noTypeLikeObjectDependencies?, objectWithDependencies?, noTypeLikeObjectAdditionalProperties?, noTypeLikeObjectRequired? }" `; exports[`Validation should fail validation for if/then/else #2 1`] = ` @@ -814,7 +860,7 @@ exports[`Validation should fail validation for maxItems 1`] = ` exports[`Validation should fail validation for maxItems Keyword 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.maxItemsKeyword should not have more than 2 items." + - configuration.maxItemsKeyword should not have more than 2 items | should be any non-array." `; exports[`Validation should fail validation for maxLength 1`] = ` @@ -822,6 +868,11 @@ exports[`Validation should fail validation for maxLength 1`] = ` - configuration.customObject.maxLength should not be longer than 3 characters." `; +exports[`Validation should fail validation for maxLength with type string 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.stringWithMaxLength should not be longer than 2 characters." +`; + exports[`Validation should fail validation for maxProperties 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - configuration.customObject.maxProperties should not have more than 3 properties." @@ -829,7 +880,7 @@ exports[`Validation should fail validation for maxProperties 1`] = ` exports[`Validation should fail validation for maxProperties 2`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.maxPropertiesKeyword should not have more than 2 properties." + - configuration.maxPropertiesKeyword should not have more than 2 properties | should be any non-object." `; exports[`Validation should fail validation for maxProperties and minProperties #2 1`] = ` @@ -850,12 +901,17 @@ exports[`Validation should fail validation for maxProperties and minProperties 1 exports[`Validation should fail validation for maxProperties without object type 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.maxPropertiesWithoutType should not have more than 0 properties." + - configuration.maxPropertiesWithoutType should not have more than 0 properties | should be any non-object." `; exports[`Validation should fail validation for maximum 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.customObject.maximumKeyword should be <= 3." + - configuration.customObject.maximumKeyword should be <= 3 | should be any non-number." +`; + +exports[`Validation should fail validation for maximum with type number 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.maximumWithTypeNumber should be <= 5." `; exports[`Validation should fail validation for min length 1`] = ` @@ -871,17 +927,27 @@ exports[`Validation should fail validation for min properties 1`] = ` exports[`Validation should fail validation for minItems Keyword 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.minItemsKeyword should not have fewer than 2 items." + - configuration.minItemsKeyword should not have fewer than 2 items | should be any non-array." +`; + +exports[`Validation should fail validation for minLength with type string 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.stringWithMinLength should not be shorter than 2 characters." `; exports[`Validation should fail validation for minProperties 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.minPropertiesKeyword should not have fewer than 2 properties." + - configuration.minPropertiesKeyword should not have fewer than 2 properties | should be any non-object." `; exports[`Validation should fail validation for minimum 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.customObject.minimumKeyword should be >= 3." + - configuration.customObject.minimumKeyword should be >= 3 | should be any non-number." +`; + +exports[`Validation should fail validation for minimum with type number 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.minimumWithTypeNumber should be >= 5." `; exports[`Validation should fail validation for missing cache group name 1`] = ` @@ -945,6 +1011,11 @@ exports[`Validation should fail validation for multiple errors 1`] = ` * configuration.output.filename should be an instance of function." `; +exports[`Validation should fail validation for multiple instanceof 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.multipleInstanceof should be an instance of \\"Array\\" | \\"Function\\"." +`; + exports[`Validation should fail validation for multiple types 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - configuration.multipleTypes should be: @@ -959,12 +1030,12 @@ exports[`Validation should fail validation for multiple types in array 1`] = ` exports[`Validation should fail validation for multiple types in contains 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.multipleContains should contains at least one number | string | boolean item." + - configuration.multipleContains should contains at least one number | string | boolean item | should be any non-array." `; exports[`Validation should fail validation for multipleOf 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.customObject.multipleOfKeyword should be multiple of 5." + - configuration.customObject.multipleOfKeyword should be multiple of 5 | should be any non-number." `; exports[`Validation should fail validation for multipleOf with minimum and maximum 1`] = ` @@ -972,6 +1043,143 @@ exports[`Validation should fail validation for multipleOf with minimum and maxim - configuration.multipleOfProp should be a number (should be >= 5, should be <= 20, should be multiple of 5)." `; +exports[`Validation should fail validation for multipleOf with type number 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.multipleOfWithNumberType should be multiple of 5." +`; + +exports[`Validation should fail validation for no type like array with additionalItems 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.noTypeLikeArrayAdditionalItems should not have more than 2 items | should be any non-array. These items are valid: + [integer, integer]" +`; + +exports[`Validation should fail validation for no type like array with contains 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.noTypeLikeArrayContains should contains at least one integer item | should be any non-array." +`; + +exports[`Validation should fail validation for no type like array with maxItems 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.noTypeLikeArrayMaxItems should not have more than 2 items | should be any non-array." +`; + +exports[`Validation should fail validation for no type like array with minItems 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.noTypeLikeArrayMinItems should not have fewer than 2 items | should be any non-array." +`; + +exports[`Validation should fail validation for no type like array with minItems 2`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.noTypeMinProperties should not have fewer than 2 properties | should be any non-object." +`; + +exports[`Validation should fail validation for no type like array with minItems 3`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.noTypeMinProperties1 should be an non-empty object | should be any non-object." +`; + +exports[`Validation should fail validation for no type like array with minItems 4`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.objectMinProperties should not have fewer than 2 properties." +`; + +exports[`Validation should fail validation for no type like array with minItems equals 1 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.noTypeLikeArrayMinItems1 should be an non-empty array | should be any non-array." +`; + +exports[`Validation should fail validation for no type like number with exclusive maximum 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.noTypeLikeNumberExclusiveMaximum should be < 5 | should be any non-number." +`; + +exports[`Validation should fail validation for no type like number with exclusive minimum 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.noTypeLikeNumberExclusiveMinimum should be > 5 | should be any non-number." +`; + +exports[`Validation should fail validation for no type like number with maximum 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.noTypeLikeNumberMaximum should be <= 5 | should be any non-number." +`; + +exports[`Validation should fail validation for no type like number with minimum 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.noTypeLikeNumberMinimum should be >= 5 | should be any non-number." +`; + +exports[`Validation should fail validation for no type like number with multipleOf 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.noTypeLikeNumberMultipleOf should be multiple of 5 | should be any non-number." +`; + +exports[`Validation should fail validation for no type like object additionalProperties 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.noTypeLikeObjectAdditionalProperties has an unknown property 'baz' | should be any non-object. These properties are valid: + object { foo? } (additional property names should match pattern \\"^.*r$\\")" +`; + +exports[`Validation should fail validation for no type like object dependencies 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.noTypeLikeObjectDependencies should have properties 'bar', 'baz' when property 'foo' is present | should be any non-object." +`; + +exports[`Validation should fail validation for no type like object propertyNames 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.noTypeLikeObjectPropertyNames property name 'foo' is invalid | should be any non-object. Property names should be match format \\"email\\"." +`; + +exports[`Validation should fail validation for no type like object required 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.noTypeLikeObjectRequired misses the property 'b' | should be any non-object." +`; + +exports[`Validation should fail validation for no type like object with maxProperties 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.noTypeLikeObjectMaxProperties should not have more than 2 properties | should be any non-object." +`; + +exports[`Validation should fail validation for no type like object with maxProperties 2`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.noTypeLikeArrayUniqueItems should not contain the item '1' twice | should be any non-array." +`; + +exports[`Validation should fail validation for no type like object with patternRequired 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.noTypeLikeObjectPatternRequired should have property matching pattern \\"f.*o\\" | should be any non-object." +`; + +exports[`Validation should fail validation for no type like string with format 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.noTypeLikeStringFormat should match format \\"date\\" | should be any non-string." +`; + +exports[`Validation should fail validation for no type like string with formatMaximum 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.noTypeLikeStringFormatMaximum should be < \\"2016-02-06\\" | should be any non-string." +`; + +exports[`Validation should fail validation for no type like string with maxLength 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.noTypeLikeStringMaxLength should not be longer than 2 characters | should be any non-string." +`; + +exports[`Validation should fail validation for no type like string with minLength 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.noTypeLikeStringMinLength should not be shorter than 2 characters | should be any non-string." +`; + +exports[`Validation should fail validation for no type like string with minLength equals 1 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.noTypeLikeStringMinLength1 should be an non-empty string | should be any non-string." +`; + +exports[`Validation should fail validation for no type like string with pattern 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.noTypeLikeStringPattern should match pattern \\"[abc]+\\" | should be any non-string." +`; + exports[`Validation should fail validation for non empty object #2 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - configuration.nonEmptyObject2 should be an object: @@ -1059,7 +1267,7 @@ exports[`Validation should fail validation for not string 1`] = ` exports[`Validation should fail validation for null configuration 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - configuration should be an object: - object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, externals?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, serve?, stats?, target?, watch?, watchOptions?, minLengthOne?, minLengthTwo?, integerType?, nullType?, allOfRef?, customObject?, objectType?, anyOfKeyword?, nestedArrayWithoutItems?, nestedObjectWithoutItems?, arrayType?, arrayType2?, multipleTypes?, zeroMaxItems?, multipleContains?, multipleContains2?, exclusiveMinimumKeyword?, exclusiveMaximumKeyword?, uniqueItemsKeyword?, minPropertiesKeyword?, maxPropertiesKeyword?, requiredKeyword?, requiredKeywordWithAdditionalProperties?, enumKeyword?, formatMinimumKeyword?, formatMaximumKeyword?, formatExclusiveMinimumKeyword?, formatExclusiveMaximumKeyword?, formatMinMaxExclusiveMinKeyword?, formatMinMaxExclusiveMaxKeyword?, minItemsKeyword?, maxItemsKeyword?, itemsKeyword?, itemsKeyword2?, additionalItemsKeyword?, additionalItemsKeyword2?, additionalItemsKeyword3?, additionalItemsKeyword4?, propertiesKeyword?, patternPropertiesKeyword?, patternPropertiesKeyword2?, arrayWithOnlyNumber?, onlyRequired?, dependenciesKeyword?, dependenciesKeyword2?, patternRequiredKeyword?, patternRequiredKeyword2?, onlyProperties?, onlyProperties2?, onlyItems?, onlyItems2?, onlyAdditionalItems?, booleanType?, additionalPropertiesKeyword?, additionalPropertiesKeyword2?, propertyNamesKeyword?, constKeyword?, constKeyword2?, ifThenElseKeyword?, ifThenElseKeyword2?, stringKeyword?, arrayKeyword?, arrayKeyword2?, arrayKeyword3?, arrayKeyword4?, arrayKeyword5?, arrayKeyword6?, arrayKeyword7?, arrayKeyword8?, arrayKeyword9?, arrayKeyword10?, arrayKeyword11?, arrayKeyword12?, arrayKeyword13?, arrayKeyword14?, arrayKeyword15?, arrayKeyword16?, arrayKeyword17?, arrayKeyword18?, arrayKeyword19?, recursion?, extending?, longString?, integerWithMinimum?, integerWithExclusiveMinimum?, integerWithExclusiveMaximum?, numberWithMinimum?, multipleOfProp?, stringWithMinAndMaxLength?, strictFormat?, strictFormat2?, uniqueItemsProp?, numberAndDescription?, oneOfnumberAndDescriptionAndArray?, maxPropertiesAndMinProperties?, objectTest?, objectTest2?, objectTest3?, objectTest4?, objectTest5?, objectTest6?, objectTest7?, objectTest8?, objectTest9?, stringWithEmptyPattern?, likeArray?, arrayWithEmptyItemsAndEmptyAdditionalItemsAndEmptyContains?, numberWithoutType?, numberWithoutType2?, stringWithoutType?, arrayWithoutType?, additionalItemsFalse?, requiredWithoutType?, dependenciesWithoutType?, propertyNamesWithoutType?, patternRequiredWithoutType?, additionalPropertiesWithoutType?, maxPropertiesWithoutType?, justAnObject?, arrayWithAbsolutePath?, allOfKeyword?, enumWithDescription?, constWithDescription?, itemsTrue?, emptyConst?, oneConst?, constWithEmptyString?, refAndAnyOf?, additionalPropertiesInsideOneOf?, additionalPropertiesInsideOneOf2?, singleContainsItems?, objectWithPropertyDependency?, objectWithPropertyDependency2?, objectWithPropertyDependency3?, objectWithPropertyDependency4?, oneOfWithIf?, constWithArrayNotation?, constWithObjectNotation?, additionalItemsWithoutType?, additionalItemsWithoutType2?, additionalItemsWithoutType3?, containsAndAdditionalItems?, containsInsideItem?, emptyObject?, nonEmptyObject?, nonEmptyObject2?, notEnum?, notConst?, notNumber?, notInteger?, notString?, notBoolean?, notArray?, notObject?, notNull?, notNotNull?, NotNotNotNull?, notMultipleTypes?, notMaxItemsArray? }" + object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, externals?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, serve?, stats?, target?, watch?, watchOptions?, minLengthOne?, minLengthTwo?, integerType?, nullType?, allOfRef?, customObject?, objectType?, anyOfKeyword?, nestedArrayWithoutItems?, nestedObjectWithoutItems?, arrayType?, arrayType2?, multipleTypes?, zeroMaxItems?, multipleContains?, multipleContains2?, exclusiveMinimumKeyword?, exclusiveMaximumKeyword?, uniqueItemsKeyword?, minPropertiesKeyword?, maxPropertiesKeyword?, requiredKeyword?, requiredKeywordWithAdditionalProperties?, enumKeyword?, formatMinimumKeyword?, formatMaximumKeyword?, formatExclusiveMinimumKeyword?, formatExclusiveMaximumKeyword?, formatMinMaxExclusiveMinKeyword?, formatMinMaxExclusiveMaxKeyword?, minItemsKeyword?, maxItemsKeyword?, itemsKeyword?, itemsKeyword2?, additionalItemsKeyword?, additionalItemsKeyword2?, additionalItemsKeyword3?, additionalItemsKeyword4?, propertiesKeyword?, patternPropertiesKeyword?, patternPropertiesKeyword2?, arrayWithOnlyNumber?, onlyRequired?, dependenciesKeyword?, dependenciesKeyword2?, patternRequiredKeyword?, patternRequiredKeyword2?, onlyProperties?, onlyProperties2?, onlyItems?, onlyItems2?, onlyAdditionalItems?, booleanType?, additionalPropertiesKeyword?, additionalPropertiesKeyword2?, propertyNamesKeyword?, constKeyword?, constKeyword2?, ifThenElseKeyword?, ifThenElseKeyword2?, stringKeyword?, arrayKeyword?, arrayKeyword2?, arrayKeyword3?, arrayKeyword4?, arrayKeyword5?, arrayKeyword6?, arrayKeyword7?, arrayKeyword8?, arrayKeyword9?, arrayKeyword10?, arrayKeyword11?, arrayKeyword12?, arrayKeyword13?, arrayKeyword14?, arrayKeyword15?, arrayKeyword16?, arrayKeyword17?, arrayKeyword18?, arrayKeyword19?, recursion?, extending?, longString?, integerWithMinimum?, integerWithExclusiveMinimum?, integerWithExclusiveMaximum?, numberWithMinimum?, multipleOfProp?, stringWithMinAndMaxLength?, strictFormat?, strictFormat2?, uniqueItemsProp?, numberAndDescription?, oneOfnumberAndDescriptionAndArray?, maxPropertiesAndMinProperties?, objectTest?, objectTest2?, objectTest3?, objectTest4?, objectTest5?, objectTest6?, objectTest7?, objectTest8?, objectTest9?, stringWithEmptyPattern?, likeArray?, arrayWithEmptyItemsAndEmptyAdditionalItemsAndEmptyContains?, numberWithoutType?, numberWithoutType2?, stringWithoutType?, arrayWithoutType?, additionalItemsFalse?, requiredWithoutType?, dependenciesWithoutType?, propertyNamesWithoutType?, patternRequiredWithoutType?, additionalPropertiesWithoutType?, maxPropertiesWithoutType?, justAnObject?, arrayWithAbsolutePath?, allOfKeyword?, enumWithDescription?, constWithDescription?, itemsTrue?, emptyConst?, oneConst?, constWithEmptyString?, refAndAnyOf?, additionalPropertiesInsideOneOf?, additionalPropertiesInsideOneOf2?, singleContainsItems?, objectWithPropertyDependency?, objectWithPropertyDependency2?, objectWithPropertyDependency3?, objectWithPropertyDependency4?, oneOfWithIf?, constWithArrayNotation?, constWithObjectNotation?, additionalItemsWithoutType?, additionalItemsWithoutType2?, additionalItemsWithoutType3?, containsAndAdditionalItems?, containsInsideItem?, emptyObject?, nonEmptyObject?, nonEmptyObject2?, notEnum?, notConst?, notNumber?, notInteger?, notString?, notBoolean?, notArray?, notObject?, notNull?, notNotNull?, NotNotNotNull?, notMultipleTypes?, notMaxItemsArray?, noTypeLikeNumberMinimum?, noTypeLikeNumberMaximum?, noTypeLikeNumberExclusiveMinimum?, noTypeLikeNumberExclusiveMaximum?, minimumWithTypeNumber?, maximumWithTypeNumber?, exclusiveMinimumWithTypeNumber?, exclusiveMaximumWithTypeNumber?, noTypeLikeNumberMultipleOf?, multipleOfWithNumberType?, noTypeLikeStringMinLength?, noTypeLikeStringMaxLength?, stringWithMinLength?, stringWithMaxLength?, noTypeLikeStringPattern?, patternWithStringType?, noTypeLikeStringFormat?, stringWithFormat?, noTypeLikeStringFormatMaximum?, stringWithFormatMaximum?, multipleInstanceof?, noTypeLikeObjectPatternRequired?, objectWithPatternRequired?, noTypeLikeStringMinLength1?, noTypeLikeArrayMinItems?, noTypeLikeArrayMinItems1?, arrayWithMinItems?, noTypeMinProperties?, noTypeMinProperties1?, objectMinProperties?, noTypeLikeArrayMaxItems?, arrayMaxItems?, noTypeLikeObjectMaxProperties?, objectMaxProperties?, noTypeLikeArrayUniqueItems?, arrayWithUniqueItems?, noTypeLikeArrayAdditionalItems?, arrayWithAdditionalItems?, noTypeLikeArrayContains?, arrayWithContains?, anyOfNoTypeInItem?, oneOfNoTypeInItem?, noTypeLikeObjectPropertyNames?, objectPropertyNames?, noTypeLikeObjectDependencies?, objectWithDependencies?, noTypeLikeObjectAdditionalProperties?, noTypeLikeObjectRequired? }" `; exports[`Validation should fail validation for null type 1`] = ` @@ -1139,7 +1347,7 @@ exports[`Validation should fail validation for object #9 2`] = ` exports[`Validation should fail validation for object #10 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.objectTest7 misses the property 'd'. + - configuration.objectTest7 misses the property 'd' | should be any non-object. -> Description about object, properties and methods." `; @@ -1151,7 +1359,7 @@ exports[`Validation should fail validation for object #11 1`] = ` exports[`Validation should fail validation for object #12 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.objectTest9 misses the property 'prop'. + - configuration.objectTest9 misses the property 'prop' | should be any non-object. -> Description about object, properties and methods." `; @@ -1161,6 +1369,16 @@ exports[`Validation should fail validation for object 1`] = ` object { a, b, c, d, f?, : number } (should not have fewer than 3 properties, should not have more than 5 properties)" `; +exports[`Validation should fail validation for object dependencies 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.objectPropertyNames property name 'foo' is invalid. Property names should be match format \\"email\\"." +`; + +exports[`Validation should fail validation for object dependencies 2`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.objectWithDependencies should have properties 'bar', 'baz' when property 'foo' is present." +`; + exports[`Validation should fail validation for object in object with anyOf 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - configuration.allOfRef.alias should be one of these: @@ -1197,6 +1415,16 @@ exports[`Validation should fail validation for object with dependencies 1`] = ` object { foo?, … } (should have properties 'bar', 'baz' when property 'foo' is present)" `; +exports[`Validation should fail validation for object with maxProperties 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.objectMaxProperties should not have more than 2 properties." +`; + +exports[`Validation should fail validation for object with maxProperties 2`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.arrayWithUniqueItems should not contain the item '1' twice." +`; + exports[`Validation should fail validation for object with required and properties 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - configuration.justAnObject should be an object: @@ -1284,6 +1512,11 @@ exports[`Validation should fail validation for oneOf with if 1`] = ` * configuration.oneOfWithIf should be a integer." `; +exports[`Validation should fail validation for oneOf with item without type 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.oneOfNoTypeInItem should be <= 3 | should be any non-number." +`; + exports[`Validation should fail validation for only items #2 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - configuration.onlyItems2[0] should be a integer. @@ -1297,7 +1530,7 @@ exports[`Validation should fail validation for only items 1`] = ` exports[`Validation should fail validation for only properties #2 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.onlyProperties2 has an unknown property 'break'. These properties are valid: + - configuration.onlyProperties2 has an unknown property 'break' | should be any non-object. These properties are valid: object { foo?, bar? }" `; @@ -1308,12 +1541,17 @@ exports[`Validation should fail validation for only properties 1`] = ` exports[`Validation should fail validation for only required 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.onlyRequired misses the property 'b'." + - configuration.onlyRequired misses the property 'b' | should be any non-object." `; exports[`Validation should fail validation for pattern 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.customObject.patternKeyword should match pattern \\"[abc]+\\"." + - configuration.customObject.patternKeyword should match pattern \\"[abc]+\\" | should be any non-string." +`; + +exports[`Validation should fail validation for pattern with type string 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.patternWithStringType should match pattern \\"[abc]+\\"." `; exports[`Validation should fail validation for patternProperties #1 1`] = ` @@ -1328,24 +1566,29 @@ exports[`Validation should fail validation for patternProperties 1`] = ` exports[`Validation should fail validation for patternRequired #2 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.patternRequiredKeyword2 should have property matching pattern \\"b.*r\\"." + - configuration.patternRequiredKeyword2 should have property matching pattern \\"b.*r\\" | should be any non-object." `; exports[`Validation should fail validation for patternRequired 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.patternRequiredKeyword should have property matching pattern \\"f.*o\\"." + - configuration.patternRequiredKeyword should have property matching pattern \\"f.*o\\" | should be any non-object." +`; + +exports[`Validation should fail validation for patternRequired with type object 1`] = ` +"Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. + - configuration.objectWithPatternRequired should have property matching pattern \\"f.*o\\"." `; exports[`Validation should fail validation for patternRequired without object type 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.patternRequiredWithoutType has an unknown property 'boo'. These properties are valid: + - configuration.patternRequiredWithoutType has an unknown property 'boo' | should be any non-object. These properties are valid: object {} (should have property matching pattern \\"b.*o\\")" `; exports[`Validation should fail validation for postFormatter #1 1`] = ` "Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema. - configuration has an unknown property 'minify'. These properties are valid: - object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, externals?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, serve?, stats?, target?, watch?, watchOptions?, minLengthOne?, minLengthTwo?, integerType?, nullType?, allOfRef?, customObject?, objectType?, anyOfKeyword?, nestedArrayWithoutItems?, nestedObjectWithoutItems?, arrayType?, arrayType2?, multipleTypes?, zeroMaxItems?, multipleContains?, multipleContains2?, exclusiveMinimumKeyword?, exclusiveMaximumKeyword?, uniqueItemsKeyword?, minPropertiesKeyword?, maxPropertiesKeyword?, requiredKeyword?, requiredKeywordWithAdditionalProperties?, enumKeyword?, formatMinimumKeyword?, formatMaximumKeyword?, formatExclusiveMinimumKeyword?, formatExclusiveMaximumKeyword?, formatMinMaxExclusiveMinKeyword?, formatMinMaxExclusiveMaxKeyword?, minItemsKeyword?, maxItemsKeyword?, itemsKeyword?, itemsKeyword2?, additionalItemsKeyword?, additionalItemsKeyword2?, additionalItemsKeyword3?, additionalItemsKeyword4?, propertiesKeyword?, patternPropertiesKeyword?, patternPropertiesKeyword2?, arrayWithOnlyNumber?, onlyRequired?, dependenciesKeyword?, dependenciesKeyword2?, patternRequiredKeyword?, patternRequiredKeyword2?, onlyProperties?, onlyProperties2?, onlyItems?, onlyItems2?, onlyAdditionalItems?, booleanType?, additionalPropertiesKeyword?, additionalPropertiesKeyword2?, propertyNamesKeyword?, constKeyword?, constKeyword2?, ifThenElseKeyword?, ifThenElseKeyword2?, stringKeyword?, arrayKeyword?, arrayKeyword2?, arrayKeyword3?, arrayKeyword4?, arrayKeyword5?, arrayKeyword6?, arrayKeyword7?, arrayKeyword8?, arrayKeyword9?, arrayKeyword10?, arrayKeyword11?, arrayKeyword12?, arrayKeyword13?, arrayKeyword14?, arrayKeyword15?, arrayKeyword16?, arrayKeyword17?, arrayKeyword18?, arrayKeyword19?, recursion?, extending?, longString?, integerWithMinimum?, integerWithExclusiveMinimum?, integerWithExclusiveMaximum?, numberWithMinimum?, multipleOfProp?, stringWithMinAndMaxLength?, strictFormat?, strictFormat2?, uniqueItemsProp?, numberAndDescription?, oneOfnumberAndDescriptionAndArray?, maxPropertiesAndMinProperties?, objectTest?, objectTest2?, objectTest3?, objectTest4?, objectTest5?, objectTest6?, objectTest7?, objectTest8?, objectTest9?, stringWithEmptyPattern?, likeArray?, arrayWithEmptyItemsAndEmptyAdditionalItemsAndEmptyContains?, numberWithoutType?, numberWithoutType2?, stringWithoutType?, arrayWithoutType?, additionalItemsFalse?, requiredWithoutType?, dependenciesWithoutType?, propertyNamesWithoutType?, patternRequiredWithoutType?, additionalPropertiesWithoutType?, maxPropertiesWithoutType?, justAnObject?, arrayWithAbsolutePath?, allOfKeyword?, enumWithDescription?, constWithDescription?, itemsTrue?, emptyConst?, oneConst?, constWithEmptyString?, refAndAnyOf?, additionalPropertiesInsideOneOf?, additionalPropertiesInsideOneOf2?, singleContainsItems?, objectWithPropertyDependency?, objectWithPropertyDependency2?, objectWithPropertyDependency3?, objectWithPropertyDependency4?, oneOfWithIf?, constWithArrayNotation?, constWithObjectNotation?, additionalItemsWithoutType?, additionalItemsWithoutType2?, additionalItemsWithoutType3?, containsAndAdditionalItems?, containsInsideItem?, emptyObject?, nonEmptyObject?, nonEmptyObject2?, notEnum?, notConst?, notNumber?, notInteger?, notString?, notBoolean?, notArray?, notObject?, notNull?, notNotNull?, NotNotNotNull?, notMultipleTypes?, notMaxItemsArray? } + object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, externals?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, serve?, stats?, target?, watch?, watchOptions?, minLengthOne?, minLengthTwo?, integerType?, nullType?, allOfRef?, customObject?, objectType?, anyOfKeyword?, nestedArrayWithoutItems?, nestedObjectWithoutItems?, arrayType?, arrayType2?, multipleTypes?, zeroMaxItems?, multipleContains?, multipleContains2?, exclusiveMinimumKeyword?, exclusiveMaximumKeyword?, uniqueItemsKeyword?, minPropertiesKeyword?, maxPropertiesKeyword?, requiredKeyword?, requiredKeywordWithAdditionalProperties?, enumKeyword?, formatMinimumKeyword?, formatMaximumKeyword?, formatExclusiveMinimumKeyword?, formatExclusiveMaximumKeyword?, formatMinMaxExclusiveMinKeyword?, formatMinMaxExclusiveMaxKeyword?, minItemsKeyword?, maxItemsKeyword?, itemsKeyword?, itemsKeyword2?, additionalItemsKeyword?, additionalItemsKeyword2?, additionalItemsKeyword3?, additionalItemsKeyword4?, propertiesKeyword?, patternPropertiesKeyword?, patternPropertiesKeyword2?, arrayWithOnlyNumber?, onlyRequired?, dependenciesKeyword?, dependenciesKeyword2?, patternRequiredKeyword?, patternRequiredKeyword2?, onlyProperties?, onlyProperties2?, onlyItems?, onlyItems2?, onlyAdditionalItems?, booleanType?, additionalPropertiesKeyword?, additionalPropertiesKeyword2?, propertyNamesKeyword?, constKeyword?, constKeyword2?, ifThenElseKeyword?, ifThenElseKeyword2?, stringKeyword?, arrayKeyword?, arrayKeyword2?, arrayKeyword3?, arrayKeyword4?, arrayKeyword5?, arrayKeyword6?, arrayKeyword7?, arrayKeyword8?, arrayKeyword9?, arrayKeyword10?, arrayKeyword11?, arrayKeyword12?, arrayKeyword13?, arrayKeyword14?, arrayKeyword15?, arrayKeyword16?, arrayKeyword17?, arrayKeyword18?, arrayKeyword19?, recursion?, extending?, longString?, integerWithMinimum?, integerWithExclusiveMinimum?, integerWithExclusiveMaximum?, numberWithMinimum?, multipleOfProp?, stringWithMinAndMaxLength?, strictFormat?, strictFormat2?, uniqueItemsProp?, numberAndDescription?, oneOfnumberAndDescriptionAndArray?, maxPropertiesAndMinProperties?, objectTest?, objectTest2?, objectTest3?, objectTest4?, objectTest5?, objectTest6?, objectTest7?, objectTest8?, objectTest9?, stringWithEmptyPattern?, likeArray?, arrayWithEmptyItemsAndEmptyAdditionalItemsAndEmptyContains?, numberWithoutType?, numberWithoutType2?, stringWithoutType?, arrayWithoutType?, additionalItemsFalse?, requiredWithoutType?, dependenciesWithoutType?, propertyNamesWithoutType?, patternRequiredWithoutType?, additionalPropertiesWithoutType?, maxPropertiesWithoutType?, justAnObject?, arrayWithAbsolutePath?, allOfKeyword?, enumWithDescription?, constWithDescription?, itemsTrue?, emptyConst?, oneConst?, constWithEmptyString?, refAndAnyOf?, additionalPropertiesInsideOneOf?, additionalPropertiesInsideOneOf2?, singleContainsItems?, objectWithPropertyDependency?, objectWithPropertyDependency2?, objectWithPropertyDependency3?, objectWithPropertyDependency4?, oneOfWithIf?, constWithArrayNotation?, constWithObjectNotation?, additionalItemsWithoutType?, additionalItemsWithoutType2?, additionalItemsWithoutType3?, containsAndAdditionalItems?, containsInsideItem?, emptyObject?, nonEmptyObject?, nonEmptyObject2?, notEnum?, notConst?, notNumber?, notInteger?, notString?, notBoolean?, notArray?, notObject?, notNull?, notNotNull?, NotNotNotNull?, notMultipleTypes?, notMaxItemsArray?, noTypeLikeNumberMinimum?, noTypeLikeNumberMaximum?, noTypeLikeNumberExclusiveMinimum?, noTypeLikeNumberExclusiveMaximum?, minimumWithTypeNumber?, maximumWithTypeNumber?, exclusiveMinimumWithTypeNumber?, exclusiveMaximumWithTypeNumber?, noTypeLikeNumberMultipleOf?, multipleOfWithNumberType?, noTypeLikeStringMinLength?, noTypeLikeStringMaxLength?, stringWithMinLength?, stringWithMaxLength?, noTypeLikeStringPattern?, patternWithStringType?, noTypeLikeStringFormat?, stringWithFormat?, noTypeLikeStringFormatMaximum?, stringWithFormatMaximum?, multipleInstanceof?, noTypeLikeObjectPatternRequired?, objectWithPatternRequired?, noTypeLikeStringMinLength1?, noTypeLikeArrayMinItems?, noTypeLikeArrayMinItems1?, arrayWithMinItems?, noTypeMinProperties?, noTypeMinProperties1?, objectMinProperties?, noTypeLikeArrayMaxItems?, arrayMaxItems?, noTypeLikeObjectMaxProperties?, objectMaxProperties?, noTypeLikeArrayUniqueItems?, arrayWithUniqueItems?, noTypeLikeArrayAdditionalItems?, arrayWithAdditionalItems?, noTypeLikeArrayContains?, arrayWithContains?, anyOfNoTypeInItem?, oneOfNoTypeInItem?, noTypeLikeObjectPropertyNames?, objectPropertyNames?, noTypeLikeObjectDependencies?, objectWithDependencies?, noTypeLikeObjectAdditionalProperties?, noTypeLikeObjectRequired? } For typos: please correct them. For loader options: webpack >= v2.0.0 no longer allows custom properties in configuration. Loaders should be updated to allow passing options via loader options in module.rules. @@ -1369,7 +1612,7 @@ exports[`Validation should fail validation for postFormatter #2 1`] = ` exports[`Validation should fail validation for postFormatter 1`] = ` "Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema. - configuration has an unknown property 'debug'. These properties are valid: - object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, externals?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, serve?, stats?, target?, watch?, watchOptions?, minLengthOne?, minLengthTwo?, integerType?, nullType?, allOfRef?, customObject?, objectType?, anyOfKeyword?, nestedArrayWithoutItems?, nestedObjectWithoutItems?, arrayType?, arrayType2?, multipleTypes?, zeroMaxItems?, multipleContains?, multipleContains2?, exclusiveMinimumKeyword?, exclusiveMaximumKeyword?, uniqueItemsKeyword?, minPropertiesKeyword?, maxPropertiesKeyword?, requiredKeyword?, requiredKeywordWithAdditionalProperties?, enumKeyword?, formatMinimumKeyword?, formatMaximumKeyword?, formatExclusiveMinimumKeyword?, formatExclusiveMaximumKeyword?, formatMinMaxExclusiveMinKeyword?, formatMinMaxExclusiveMaxKeyword?, minItemsKeyword?, maxItemsKeyword?, itemsKeyword?, itemsKeyword2?, additionalItemsKeyword?, additionalItemsKeyword2?, additionalItemsKeyword3?, additionalItemsKeyword4?, propertiesKeyword?, patternPropertiesKeyword?, patternPropertiesKeyword2?, arrayWithOnlyNumber?, onlyRequired?, dependenciesKeyword?, dependenciesKeyword2?, patternRequiredKeyword?, patternRequiredKeyword2?, onlyProperties?, onlyProperties2?, onlyItems?, onlyItems2?, onlyAdditionalItems?, booleanType?, additionalPropertiesKeyword?, additionalPropertiesKeyword2?, propertyNamesKeyword?, constKeyword?, constKeyword2?, ifThenElseKeyword?, ifThenElseKeyword2?, stringKeyword?, arrayKeyword?, arrayKeyword2?, arrayKeyword3?, arrayKeyword4?, arrayKeyword5?, arrayKeyword6?, arrayKeyword7?, arrayKeyword8?, arrayKeyword9?, arrayKeyword10?, arrayKeyword11?, arrayKeyword12?, arrayKeyword13?, arrayKeyword14?, arrayKeyword15?, arrayKeyword16?, arrayKeyword17?, arrayKeyword18?, arrayKeyword19?, recursion?, extending?, longString?, integerWithMinimum?, integerWithExclusiveMinimum?, integerWithExclusiveMaximum?, numberWithMinimum?, multipleOfProp?, stringWithMinAndMaxLength?, strictFormat?, strictFormat2?, uniqueItemsProp?, numberAndDescription?, oneOfnumberAndDescriptionAndArray?, maxPropertiesAndMinProperties?, objectTest?, objectTest2?, objectTest3?, objectTest4?, objectTest5?, objectTest6?, objectTest7?, objectTest8?, objectTest9?, stringWithEmptyPattern?, likeArray?, arrayWithEmptyItemsAndEmptyAdditionalItemsAndEmptyContains?, numberWithoutType?, numberWithoutType2?, stringWithoutType?, arrayWithoutType?, additionalItemsFalse?, requiredWithoutType?, dependenciesWithoutType?, propertyNamesWithoutType?, patternRequiredWithoutType?, additionalPropertiesWithoutType?, maxPropertiesWithoutType?, justAnObject?, arrayWithAbsolutePath?, allOfKeyword?, enumWithDescription?, constWithDescription?, itemsTrue?, emptyConst?, oneConst?, constWithEmptyString?, refAndAnyOf?, additionalPropertiesInsideOneOf?, additionalPropertiesInsideOneOf2?, singleContainsItems?, objectWithPropertyDependency?, objectWithPropertyDependency2?, objectWithPropertyDependency3?, objectWithPropertyDependency4?, oneOfWithIf?, constWithArrayNotation?, constWithObjectNotation?, additionalItemsWithoutType?, additionalItemsWithoutType2?, additionalItemsWithoutType3?, containsAndAdditionalItems?, containsInsideItem?, emptyObject?, nonEmptyObject?, nonEmptyObject2?, notEnum?, notConst?, notNumber?, notInteger?, notString?, notBoolean?, notArray?, notObject?, notNull?, notNotNull?, NotNotNotNull?, notMultipleTypes?, notMaxItemsArray? } + object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, externals?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, serve?, stats?, target?, watch?, watchOptions?, minLengthOne?, minLengthTwo?, integerType?, nullType?, allOfRef?, customObject?, objectType?, anyOfKeyword?, nestedArrayWithoutItems?, nestedObjectWithoutItems?, arrayType?, arrayType2?, multipleTypes?, zeroMaxItems?, multipleContains?, multipleContains2?, exclusiveMinimumKeyword?, exclusiveMaximumKeyword?, uniqueItemsKeyword?, minPropertiesKeyword?, maxPropertiesKeyword?, requiredKeyword?, requiredKeywordWithAdditionalProperties?, enumKeyword?, formatMinimumKeyword?, formatMaximumKeyword?, formatExclusiveMinimumKeyword?, formatExclusiveMaximumKeyword?, formatMinMaxExclusiveMinKeyword?, formatMinMaxExclusiveMaxKeyword?, minItemsKeyword?, maxItemsKeyword?, itemsKeyword?, itemsKeyword2?, additionalItemsKeyword?, additionalItemsKeyword2?, additionalItemsKeyword3?, additionalItemsKeyword4?, propertiesKeyword?, patternPropertiesKeyword?, patternPropertiesKeyword2?, arrayWithOnlyNumber?, onlyRequired?, dependenciesKeyword?, dependenciesKeyword2?, patternRequiredKeyword?, patternRequiredKeyword2?, onlyProperties?, onlyProperties2?, onlyItems?, onlyItems2?, onlyAdditionalItems?, booleanType?, additionalPropertiesKeyword?, additionalPropertiesKeyword2?, propertyNamesKeyword?, constKeyword?, constKeyword2?, ifThenElseKeyword?, ifThenElseKeyword2?, stringKeyword?, arrayKeyword?, arrayKeyword2?, arrayKeyword3?, arrayKeyword4?, arrayKeyword5?, arrayKeyword6?, arrayKeyword7?, arrayKeyword8?, arrayKeyword9?, arrayKeyword10?, arrayKeyword11?, arrayKeyword12?, arrayKeyword13?, arrayKeyword14?, arrayKeyword15?, arrayKeyword16?, arrayKeyword17?, arrayKeyword18?, arrayKeyword19?, recursion?, extending?, longString?, integerWithMinimum?, integerWithExclusiveMinimum?, integerWithExclusiveMaximum?, numberWithMinimum?, multipleOfProp?, stringWithMinAndMaxLength?, strictFormat?, strictFormat2?, uniqueItemsProp?, numberAndDescription?, oneOfnumberAndDescriptionAndArray?, maxPropertiesAndMinProperties?, objectTest?, objectTest2?, objectTest3?, objectTest4?, objectTest5?, objectTest6?, objectTest7?, objectTest8?, objectTest9?, stringWithEmptyPattern?, likeArray?, arrayWithEmptyItemsAndEmptyAdditionalItemsAndEmptyContains?, numberWithoutType?, numberWithoutType2?, stringWithoutType?, arrayWithoutType?, additionalItemsFalse?, requiredWithoutType?, dependenciesWithoutType?, propertyNamesWithoutType?, patternRequiredWithoutType?, additionalPropertiesWithoutType?, maxPropertiesWithoutType?, justAnObject?, arrayWithAbsolutePath?, allOfKeyword?, enumWithDescription?, constWithDescription?, itemsTrue?, emptyConst?, oneConst?, constWithEmptyString?, refAndAnyOf?, additionalPropertiesInsideOneOf?, additionalPropertiesInsideOneOf2?, singleContainsItems?, objectWithPropertyDependency?, objectWithPropertyDependency2?, objectWithPropertyDependency3?, objectWithPropertyDependency4?, oneOfWithIf?, constWithArrayNotation?, constWithObjectNotation?, additionalItemsWithoutType?, additionalItemsWithoutType2?, additionalItemsWithoutType3?, containsAndAdditionalItems?, containsInsideItem?, emptyObject?, nonEmptyObject?, nonEmptyObject2?, notEnum?, notConst?, notNumber?, notInteger?, notString?, notBoolean?, notArray?, notObject?, notNull?, notNotNull?, NotNotNotNull?, notMultipleTypes?, notMaxItemsArray?, noTypeLikeNumberMinimum?, noTypeLikeNumberMaximum?, noTypeLikeNumberExclusiveMinimum?, noTypeLikeNumberExclusiveMaximum?, minimumWithTypeNumber?, maximumWithTypeNumber?, exclusiveMinimumWithTypeNumber?, exclusiveMaximumWithTypeNumber?, noTypeLikeNumberMultipleOf?, multipleOfWithNumberType?, noTypeLikeStringMinLength?, noTypeLikeStringMaxLength?, stringWithMinLength?, stringWithMaxLength?, noTypeLikeStringPattern?, patternWithStringType?, noTypeLikeStringFormat?, stringWithFormat?, noTypeLikeStringFormatMaximum?, stringWithFormatMaximum?, multipleInstanceof?, noTypeLikeObjectPatternRequired?, objectWithPatternRequired?, noTypeLikeStringMinLength1?, noTypeLikeArrayMinItems?, noTypeLikeArrayMinItems1?, arrayWithMinItems?, noTypeMinProperties?, noTypeMinProperties1?, objectMinProperties?, noTypeLikeArrayMaxItems?, arrayMaxItems?, noTypeLikeObjectMaxProperties?, objectMaxProperties?, noTypeLikeArrayUniqueItems?, arrayWithUniqueItems?, noTypeLikeArrayAdditionalItems?, arrayWithAdditionalItems?, noTypeLikeArrayContains?, arrayWithContains?, anyOfNoTypeInItem?, oneOfNoTypeInItem?, noTypeLikeObjectPropertyNames?, objectPropertyNames?, noTypeLikeObjectDependencies?, objectWithDependencies?, noTypeLikeObjectAdditionalProperties?, noTypeLikeObjectRequired? } The 'debug' property was removed in webpack 2.0.0. Loaders should be updated to allow passing this option via loader options in module.rules. Until loaders are updated one can use the LoaderOptionsPlugin to switch loaders into debug mode: @@ -1387,13 +1630,13 @@ exports[`Validation should fail validation for properties 1`] = ` exports[`Validation should fail validation for propertyNames 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.propertyNamesKeyword property name 'foo' is invalid. Property names should be match format \\"email\\". + - configuration.propertyNamesKeyword property name 'foo' is invalid | should be any non-object. Property names should be match format \\"email\\". -> Description" `; exports[`Validation should fail validation for propertyNames without object type 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.propertyNamesWithoutType has an unknown property 'foo'. These properties are valid: + - configuration.propertyNamesWithoutType has an unknown property 'foo' | should be any non-object. These properties are valid: object {} (each property name should match format \\"email\\")" `; @@ -1422,22 +1665,22 @@ exports[`Validation should fail validation for repeated value 1`] = ` exports[`Validation should fail validation for required #2 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.requiredKeyword misses the property 'a'." + - configuration.requiredKeyword misses the property 'a' | should be any non-object." `; exports[`Validation should fail validation for required 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.requiredKeyword misses the property 'b'." + - configuration.requiredKeyword misses the property 'b' | should be any non-object." `; exports[`Validation should fail validation for required with additionalProperties 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.requiredKeywordWithAdditionalProperties misses the property 'a'." + - configuration.requiredKeywordWithAdditionalProperties misses the property 'a' | should be any non-object." `; exports[`Validation should fail validation for required without object type 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.requiredWithoutType has an unknown property 'b'. These properties are valid: + - configuration.requiredWithoutType has an unknown property 'b' | should be any non-object. These properties are valid: object { a }" `; @@ -1481,7 +1724,7 @@ exports[`Validation should fail validation for terser-webpack-plugin name 1`] = exports[`Validation should fail validation for undefined configuration 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - configuration should be an object: - object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, externals?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, serve?, stats?, target?, watch?, watchOptions?, minLengthOne?, minLengthTwo?, integerType?, nullType?, allOfRef?, customObject?, objectType?, anyOfKeyword?, nestedArrayWithoutItems?, nestedObjectWithoutItems?, arrayType?, arrayType2?, multipleTypes?, zeroMaxItems?, multipleContains?, multipleContains2?, exclusiveMinimumKeyword?, exclusiveMaximumKeyword?, uniqueItemsKeyword?, minPropertiesKeyword?, maxPropertiesKeyword?, requiredKeyword?, requiredKeywordWithAdditionalProperties?, enumKeyword?, formatMinimumKeyword?, formatMaximumKeyword?, formatExclusiveMinimumKeyword?, formatExclusiveMaximumKeyword?, formatMinMaxExclusiveMinKeyword?, formatMinMaxExclusiveMaxKeyword?, minItemsKeyword?, maxItemsKeyword?, itemsKeyword?, itemsKeyword2?, additionalItemsKeyword?, additionalItemsKeyword2?, additionalItemsKeyword3?, additionalItemsKeyword4?, propertiesKeyword?, patternPropertiesKeyword?, patternPropertiesKeyword2?, arrayWithOnlyNumber?, onlyRequired?, dependenciesKeyword?, dependenciesKeyword2?, patternRequiredKeyword?, patternRequiredKeyword2?, onlyProperties?, onlyProperties2?, onlyItems?, onlyItems2?, onlyAdditionalItems?, booleanType?, additionalPropertiesKeyword?, additionalPropertiesKeyword2?, propertyNamesKeyword?, constKeyword?, constKeyword2?, ifThenElseKeyword?, ifThenElseKeyword2?, stringKeyword?, arrayKeyword?, arrayKeyword2?, arrayKeyword3?, arrayKeyword4?, arrayKeyword5?, arrayKeyword6?, arrayKeyword7?, arrayKeyword8?, arrayKeyword9?, arrayKeyword10?, arrayKeyword11?, arrayKeyword12?, arrayKeyword13?, arrayKeyword14?, arrayKeyword15?, arrayKeyword16?, arrayKeyword17?, arrayKeyword18?, arrayKeyword19?, recursion?, extending?, longString?, integerWithMinimum?, integerWithExclusiveMinimum?, integerWithExclusiveMaximum?, numberWithMinimum?, multipleOfProp?, stringWithMinAndMaxLength?, strictFormat?, strictFormat2?, uniqueItemsProp?, numberAndDescription?, oneOfnumberAndDescriptionAndArray?, maxPropertiesAndMinProperties?, objectTest?, objectTest2?, objectTest3?, objectTest4?, objectTest5?, objectTest6?, objectTest7?, objectTest8?, objectTest9?, stringWithEmptyPattern?, likeArray?, arrayWithEmptyItemsAndEmptyAdditionalItemsAndEmptyContains?, numberWithoutType?, numberWithoutType2?, stringWithoutType?, arrayWithoutType?, additionalItemsFalse?, requiredWithoutType?, dependenciesWithoutType?, propertyNamesWithoutType?, patternRequiredWithoutType?, additionalPropertiesWithoutType?, maxPropertiesWithoutType?, justAnObject?, arrayWithAbsolutePath?, allOfKeyword?, enumWithDescription?, constWithDescription?, itemsTrue?, emptyConst?, oneConst?, constWithEmptyString?, refAndAnyOf?, additionalPropertiesInsideOneOf?, additionalPropertiesInsideOneOf2?, singleContainsItems?, objectWithPropertyDependency?, objectWithPropertyDependency2?, objectWithPropertyDependency3?, objectWithPropertyDependency4?, oneOfWithIf?, constWithArrayNotation?, constWithObjectNotation?, additionalItemsWithoutType?, additionalItemsWithoutType2?, additionalItemsWithoutType3?, containsAndAdditionalItems?, containsInsideItem?, emptyObject?, nonEmptyObject?, nonEmptyObject2?, notEnum?, notConst?, notNumber?, notInteger?, notString?, notBoolean?, notArray?, notObject?, notNull?, notNotNull?, NotNotNotNull?, notMultipleTypes?, notMaxItemsArray? }" + object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, externals?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, serve?, stats?, target?, watch?, watchOptions?, minLengthOne?, minLengthTwo?, integerType?, nullType?, allOfRef?, customObject?, objectType?, anyOfKeyword?, nestedArrayWithoutItems?, nestedObjectWithoutItems?, arrayType?, arrayType2?, multipleTypes?, zeroMaxItems?, multipleContains?, multipleContains2?, exclusiveMinimumKeyword?, exclusiveMaximumKeyword?, uniqueItemsKeyword?, minPropertiesKeyword?, maxPropertiesKeyword?, requiredKeyword?, requiredKeywordWithAdditionalProperties?, enumKeyword?, formatMinimumKeyword?, formatMaximumKeyword?, formatExclusiveMinimumKeyword?, formatExclusiveMaximumKeyword?, formatMinMaxExclusiveMinKeyword?, formatMinMaxExclusiveMaxKeyword?, minItemsKeyword?, maxItemsKeyword?, itemsKeyword?, itemsKeyword2?, additionalItemsKeyword?, additionalItemsKeyword2?, additionalItemsKeyword3?, additionalItemsKeyword4?, propertiesKeyword?, patternPropertiesKeyword?, patternPropertiesKeyword2?, arrayWithOnlyNumber?, onlyRequired?, dependenciesKeyword?, dependenciesKeyword2?, patternRequiredKeyword?, patternRequiredKeyword2?, onlyProperties?, onlyProperties2?, onlyItems?, onlyItems2?, onlyAdditionalItems?, booleanType?, additionalPropertiesKeyword?, additionalPropertiesKeyword2?, propertyNamesKeyword?, constKeyword?, constKeyword2?, ifThenElseKeyword?, ifThenElseKeyword2?, stringKeyword?, arrayKeyword?, arrayKeyword2?, arrayKeyword3?, arrayKeyword4?, arrayKeyword5?, arrayKeyword6?, arrayKeyword7?, arrayKeyword8?, arrayKeyword9?, arrayKeyword10?, arrayKeyword11?, arrayKeyword12?, arrayKeyword13?, arrayKeyword14?, arrayKeyword15?, arrayKeyword16?, arrayKeyword17?, arrayKeyword18?, arrayKeyword19?, recursion?, extending?, longString?, integerWithMinimum?, integerWithExclusiveMinimum?, integerWithExclusiveMaximum?, numberWithMinimum?, multipleOfProp?, stringWithMinAndMaxLength?, strictFormat?, strictFormat2?, uniqueItemsProp?, numberAndDescription?, oneOfnumberAndDescriptionAndArray?, maxPropertiesAndMinProperties?, objectTest?, objectTest2?, objectTest3?, objectTest4?, objectTest5?, objectTest6?, objectTest7?, objectTest8?, objectTest9?, stringWithEmptyPattern?, likeArray?, arrayWithEmptyItemsAndEmptyAdditionalItemsAndEmptyContains?, numberWithoutType?, numberWithoutType2?, stringWithoutType?, arrayWithoutType?, additionalItemsFalse?, requiredWithoutType?, dependenciesWithoutType?, propertyNamesWithoutType?, patternRequiredWithoutType?, additionalPropertiesWithoutType?, maxPropertiesWithoutType?, justAnObject?, arrayWithAbsolutePath?, allOfKeyword?, enumWithDescription?, constWithDescription?, itemsTrue?, emptyConst?, oneConst?, constWithEmptyString?, refAndAnyOf?, additionalPropertiesInsideOneOf?, additionalPropertiesInsideOneOf2?, singleContainsItems?, objectWithPropertyDependency?, objectWithPropertyDependency2?, objectWithPropertyDependency3?, objectWithPropertyDependency4?, oneOfWithIf?, constWithArrayNotation?, constWithObjectNotation?, additionalItemsWithoutType?, additionalItemsWithoutType2?, additionalItemsWithoutType3?, containsAndAdditionalItems?, containsInsideItem?, emptyObject?, nonEmptyObject?, nonEmptyObject2?, notEnum?, notConst?, notNumber?, notInteger?, notString?, notBoolean?, notArray?, notObject?, notNull?, notNotNull?, NotNotNotNull?, notMultipleTypes?, notMaxItemsArray?, noTypeLikeNumberMinimum?, noTypeLikeNumberMaximum?, noTypeLikeNumberExclusiveMinimum?, noTypeLikeNumberExclusiveMaximum?, minimumWithTypeNumber?, maximumWithTypeNumber?, exclusiveMinimumWithTypeNumber?, exclusiveMaximumWithTypeNumber?, noTypeLikeNumberMultipleOf?, multipleOfWithNumberType?, noTypeLikeStringMinLength?, noTypeLikeStringMaxLength?, stringWithMinLength?, stringWithMaxLength?, noTypeLikeStringPattern?, patternWithStringType?, noTypeLikeStringFormat?, stringWithFormat?, noTypeLikeStringFormatMaximum?, stringWithFormatMaximum?, multipleInstanceof?, noTypeLikeObjectPatternRequired?, objectWithPatternRequired?, noTypeLikeStringMinLength1?, noTypeLikeArrayMinItems?, noTypeLikeArrayMinItems1?, arrayWithMinItems?, noTypeMinProperties?, noTypeMinProperties1?, objectMinProperties?, noTypeLikeArrayMaxItems?, arrayMaxItems?, noTypeLikeObjectMaxProperties?, objectMaxProperties?, noTypeLikeArrayUniqueItems?, arrayWithUniqueItems?, noTypeLikeArrayAdditionalItems?, arrayWithAdditionalItems?, noTypeLikeArrayContains?, arrayWithContains?, anyOfNoTypeInItem?, oneOfNoTypeInItem?, noTypeLikeObjectPropertyNames?, objectPropertyNames?, noTypeLikeObjectDependencies?, objectWithDependencies?, noTypeLikeObjectAdditionalProperties?, noTypeLikeObjectRequired? }" `; exports[`Validation should fail validation for uniqueItems #2 1`] = ` @@ -1491,7 +1734,7 @@ exports[`Validation should fail validation for uniqueItems #2 1`] = ` exports[`Validation should fail validation for uniqueItems 1`] = ` "Invalid configuration object. Object has been initialised using a configuration object that does not match the API schema. - - configuration.uniqueItemsKeyword should not contain the item '1' twice." + - configuration.uniqueItemsKeyword should not contain the item '1' twice | should be any non-array." `; exports[`Validation should fail validation for uniqueItems 2`] = ` diff --git a/test/fixtures/schema.json b/test/fixtures/schema.json index 33c92ad..022b871 100644 --- a/test/fixtures/schema.json +++ b/test/fixtures/schema.json @@ -3490,6 +3490,202 @@ "type": "integer" } } + }, + "noTypeLikeNumberMinimum": { + "minimum": 5 + }, + "noTypeLikeNumberMaximum": { + "maximum": 5 + }, + "noTypeLikeNumberExclusiveMinimum": { + "exclusiveMinimum": 5 + }, + "noTypeLikeNumberExclusiveMaximum": { + "exclusiveMaximum": 5 + }, + "minimumWithTypeNumber": { + "type": "number", + "minimum": 5 + }, + "maximumWithTypeNumber": { + "type": "number", + "maximum": 5 + }, + "exclusiveMinimumWithTypeNumber": { + "type": "number", + "minimum": 5 + }, + "exclusiveMaximumWithTypeNumber": { + "type": "number", + "maximum": 5 + }, + "noTypeLikeNumberMultipleOf": { + "multipleOf": 5 + }, + "multipleOfWithNumberType": { + "type": "number", + "multipleOf": 5 + }, + "noTypeLikeStringMinLength": { + "minLength": 2 + }, + "noTypeLikeStringMaxLength": { + "maxLength": 2 + }, + "stringWithMinLength": { + "type": "string", + "minLength": 2 + }, + "stringWithMaxLength": { + "type": "string", + "maxLength": 2 + }, + "noTypeLikeStringPattern": { + "pattern": "[abc]+" + }, + "patternWithStringType" : { + "type": "string", + "pattern": "[abc]+" + }, + "noTypeLikeStringFormat": { + "format": "date" + }, + "stringWithFormat": { + "type": "string", + "format": "date" + }, + "noTypeLikeStringFormatMaximum": { + "format": "date", + "formatMaximum": "2016-02-06", + "formatExclusiveMaximum": true + }, + "stringWithFormatMaximum": { + "type": "string", + "format": "date", + "formatMaximum": "2016-02-06", + "formatExclusiveMaximum": true + }, + "multipleInstanceof": { + "instanceof": ["Array", "Function"] + }, + "noTypeLikeObjectPatternRequired": { + "patternRequired": [ "f.*o" ] + }, + "objectWithPatternRequired": { + "type": "object", + "patternRequired": [ "f.*o" ] + }, + "noTypeLikeStringMinLength1": { + "minLength": 1 + }, + "noTypeLikeArrayMinItems": { + "minItems": 2 + }, + "noTypeLikeArrayMinItems1": { + "minItems": 1 + }, + "arrayWithMinItems": { + "type": "array", + "minItems": 1 + }, + "noTypeMinProperties": { + "minProperties": 2 + }, + "noTypeMinProperties1": { + "minProperties": 1 + }, + "objectMinProperties": { + "type": "object", + "minProperties": 2 + }, + "noTypeLikeArrayMaxItems": { + "maxItems": 2 + }, + "arrayMaxItems": { + "type": "array", + "maxItems": 2 + }, + "noTypeLikeObjectMaxProperties": { + "maxProperties": 2 + }, + "objectMaxProperties": { + "type": "object", + "maxProperties": 2 + }, + "noTypeLikeArrayUniqueItems": { + "uniqueItems": true + }, + "arrayWithUniqueItems": { + "type": "array", + "uniqueItems": true + }, + "noTypeLikeArrayAdditionalItems": { + "items": [ + { "type": "integer" }, + { "type": "integer" } + ], + "additionalItems": false + }, + "arrayWithAdditionalItems": { + "type": "array", + "items": [ + { "type": "integer" }, + { "type": "integer" } + ], + "additionalItems": false + }, + "noTypeLikeArrayContains": { + "contains": { + "type": "integer" + } + }, + "arrayWithContains": { + "type": "array", + "contains": { + "type": "integer" + } + }, + "anyOfNoTypeInItem": { + "anyOf": [ + { "maximum": 3 }, + { "type": "integer" } + ] + }, + "oneOfNoTypeInItem": { + "oneOf": [ + { "maximum": 3 }, + { "type": "integer" } + ] + }, + "noTypeLikeObjectPropertyNames": { + "propertyNames": { "format": "email" } + }, + "objectPropertyNames": { + "type": "object", + "propertyNames": { "format": "email" } + }, + "noTypeLikeObjectDependencies": { + "dependencies": { + "foo": ["bar", "baz"] + } + }, + "objectWithDependencies": { + "type": "object", + "dependencies": { + "foo": ["bar", "baz"] + } + }, + "noTypeLikeObjectAdditionalProperties": { + "properties": { + "foo": { "type": "number" } + }, + "patternProperties": { + "^.*r$": { "type": "number" } + }, + "additionalProperties": false + }, + "noTypeLikeObjectRequired":{ + "required": ["a", "b"] } } } diff --git a/test/index.test.js b/test/index.test.js index bfe5091..3cc7e0e 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -224,6 +224,58 @@ describe('Validation', () => { notArray: 1, }); + createSuccessTestCase('no type like number with minimum', { + noTypeLikeNumberMinimum: 6, + }); + + createSuccessTestCase('no type like number with minimum', { + noTypeLikeNumberMinimum: true, + }); + + createSuccessTestCase('no type like number with maximum', { + noTypeLikeNumberMaximum: 4, + }); + + createSuccessTestCase('no type like number with maximum', { + noTypeLikeNumberMaximum: true, + }); + + createSuccessTestCase('no type like number with minimum', { + noTypeLikeNumberExclusiveMinimum: 6, + }); + + createSuccessTestCase('no type like number with minimum', { + noTypeLikeNumberExclusiveMinimum: true, + }); + + createSuccessTestCase('no type like number with maximum', { + noTypeLikeNumberExclusiveMaximum: 4, + }); + + createSuccessTestCase('no type like number with maximum', { + noTypeLikeNumberExclusiveMaximum: true, + }); + + createSuccessTestCase('no type like number with multipleOf', { + noTypeLikeNumberMultipleOf: true, + }); + + createSuccessTestCase('no type like string with pattern', { + noTypeLikeStringPattern: 1, + }); + + createSuccessTestCase('no type like string with pattern #2', { + noTypeLikeStringPattern: 'a', + }); + + createSuccessTestCase('no type like string with MinLength equals 1', { + noTypeLikeStringMinLength1: 1, + }); + + createSuccessTestCase('no type like array with additionalItems', { + noTypeLikeArrayAdditionalItems: true, + }); + // The "name" option createFailedTestCase( 'webpack name', @@ -2332,4 +2384,388 @@ describe('Validation', () => { }, (msg) => expect(msg).toMatchSnapshot() ); + + createFailedTestCase( + 'no type like number with minimum', + { + noTypeLikeNumberMinimum: 4, + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'no type like number with maximum', + { + noTypeLikeNumberMaximum: 6, + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'no type like number with exclusive minimum', + { + noTypeLikeNumberExclusiveMinimum: 4, + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'no type like number with exclusive maximum', + { + noTypeLikeNumberExclusiveMaximum: 6, + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'minimum with type number', + { + minimumWithTypeNumber: 4, + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'maximum with type number', + { + maximumWithTypeNumber: 6, + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'exclusive minimum with type number', + { + exclusiveMinimumWithTypeNumber: 4, + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'exclusive maximum with type number', + { + exclusiveMaximumWithTypeNumber: 6, + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'no type like number with multipleOf', + { + noTypeLikeNumberMultipleOf: 1, + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'multipleOf with type number', + { + multipleOfWithNumberType: 1, + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'no type like string with minLength', + { + noTypeLikeStringMinLength: 'a', + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'no type like string with maxLength', + { + noTypeLikeStringMaxLength: 'aaa', + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'minLength with type string', + { + stringWithMinLength: 'a', + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'maxLength with type string', + { + stringWithMaxLength: 'aaa', + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'no type like string with pattern', + { + noTypeLikeStringPattern: 'def', + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'pattern with type string', + { + patternWithStringType: 'def', + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'no type like string with format', + { + noTypeLikeStringFormat: 'abc', + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'format with type string', + { + stringWithFormat: 'abc', + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'no type like string with formatMaximum', + { + noTypeLikeStringFormatMaximum: '2016-02-06', + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'formatMaximum with type string', + { + stringWithFormatMaximum: '2016-02-06', + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'multiple instanceof ', + { + multipleInstanceof: 'test', + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'no type like object with patternRequired', + { + noTypeLikeObjectPatternRequired: { bar: 2 }, + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'patternRequired with type object', + { + objectWithPatternRequired: { bar: 2 }, + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'no type like string with minLength equals 1', + { + noTypeLikeStringMinLength1: '', + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'no type like array with minItems equals 1', + { + noTypeLikeArrayMinItems1: [], + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'no type like array with minItems', + { + noTypeLikeArrayMinItems: [], + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'array with minItems', + { + arrayWithMinItems: [], + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'no type like array with minItems', + { + noTypeMinProperties: {}, + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'no type like array with minItems', + { + noTypeMinProperties1: {}, + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'no type like array with minItems', + { + objectMinProperties: {}, + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'no type like array with maxItems', + { + noTypeLikeArrayMaxItems: [1, 2, 3, 4], + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'array with maxItems', + { + arrayMaxItems: [1, 2, 3, 4], + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'no type like object with maxProperties', + { + noTypeLikeObjectMaxProperties: { a: 1, b: 2, c: 3 }, + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'object with maxProperties', + { + objectMaxProperties: { a: 1, b: 2, c: 3 }, + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'no type like object with maxProperties', + { + noTypeLikeArrayUniqueItems: [1, 2, 1], + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'object with maxProperties', + { + arrayWithUniqueItems: [1, 2, 1], + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'no type like array with additionalItems', + { + noTypeLikeArrayAdditionalItems: [1, 1, 'foo'], + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'array with additionalItems', + { + arrayWithAdditionalItems: [1, 1, 'foo'], + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'no type like array with contains', + { + noTypeLikeArrayContains: ['foo', 'bar'], + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'array with contains', + { + arrayWithContains: ['foo', 'bar'], + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'anyOf with item without type', + { + anyOfNoTypeInItem: 4.5, + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'oneOf with item without type', + { + oneOfNoTypeInItem: 4.5, + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'no type like object propertyNames', + { + noTypeLikeObjectPropertyNames: { foo: 'any value' }, + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'object dependencies', + { + objectPropertyNames: { foo: 'any value' }, + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'no type like object dependencies', + { + noTypeLikeObjectDependencies: { foo: 1, baz: 3 }, + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'object dependencies', + { + objectWithDependencies: { foo: 1, baz: 3 }, + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'no type like object additionalProperties', + { + noTypeLikeObjectAdditionalProperties: { foo: 1, baz: 3 }, + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + 'no type like object required', + { + noTypeLikeObjectRequired: {}, + }, + (msg) => expect(msg).toMatchSnapshot() + ); });