Skip to content

update: validate to catch input-error #76

update: validate to catch input-error

update: validate to catch input-error #76

GitHub Actions / unit test results succeeded Apr 14, 2024 in 0s

unit test results ✔️

Tests passed successfully

✔️ test-result-unit.json

466 tests were completed in 142ms with 465 passed, 0 failed and 1 skipped.

Test suite Passed Failed Skipped Time
test/unit/compile/getRef.test.ts 12✔️ 3ms
test/unit/compile/joinScope.test.ts 11✔️ 0ms
test/unit/compile/splitRef.test.ts 9✔️ 1ms
test/unit/compileSchema.test.ts 37✔️ 9ms
test/unit/compileSchemaV6.test.ts 5✔️ 2ms
test/unit/createSchemaOf.test.ts 5✔️ 0ms
test/unit/docs/docs.test.ts 8✔️ 4ms
test/unit/docs/remoteSchema.test.ts 5✔️ 1ms
test/unit/each.test.ts 5✔️ 1ms
test/unit/eachSchema.test.ts 17✔️ 3ms
test/unit/getChildSchemaSelection.test.ts 4✔️ 1ms
test/unit/getSchema.test.ts 22✔️ 7ms
test/unit/getTemplate.test.ts 77✔️ 8ms
test/unit/getTemplate7.test.ts 8✔️ 2ms
test/unit/getTypeOf.test.ts 9✔️ 0ms
test/unit/issues/issue19.getSchema.dependencies.test.ts 2✔️ 1ms
test/unit/issues/issue21.getTemplate.test.ts 1✔️ 0ms
test/unit/issues/issue22.each.test.ts 1✔️ 0ms
test/unit/issues/issue32.getTemplate.integer.test.ts 1✔️ 0ms
test/unit/issues/issue33.rootOneOf.test.ts 7✔️ 2ms
test/unit/issues/issue38.getTemplate.anyOf.test.ts 1✔️ 0ms
test/unit/issues/issue43.multipleOf.float.test.ts 11✔️ 3ms
test/unit/issues/issue44.chainedNegLogic.test.ts 1✔️ 0ms
test/unit/issues/issue57.allOfMutatesData.test.ts 2✔️ 0ms
test/unit/isValid.test.ts 3✔️ 1ms
test/unit/mergeSchema.test.ts 9✔️ 1ms
test/unit/reduceSchema.test.ts 2✔️ 0ms
test/unit/resolveAllOf.test.ts 10✔️ 2ms
test/unit/resolveDynamicSchema.test.ts 15✔️ 4ms
test/unit/resolveOneOf.fuzzy.test.ts 13✔️ 3ms
test/unit/resolveOneOf.oneOfProperty.test.ts 4✔️ 1ms
test/unit/step/step.oneOf.test.ts 4✔️ 1ms
test/unit/step/step.test.ts 24✔️ 5ms
test/unit/step/step7.allOf.test.ts 1✖️ 0ms
test/unit/utils/getPrecision.test.ts 1✔️ 0ms
test/unit/utils/merge.test.ts 3✔️ 0ms
test/unit/validate.format.test.ts 9✔️ 1ms
test/unit/validate.test.ts 96✔️ 14ms
test/unit/validateAsync.test.ts 4✔️ 0ms
test/unit/validateV7.test.ts 7✔️ 0ms

✔️ test/unit/compile/getRef.test.ts

compile.getRef
  ✔️ should resolve ids to pointer
  ✔️ should return remote schema
  ✔️ should return rootSchema
  ✔️ should return value for json-pointer uri
compile.getRef host/target
  ✔️ should call 'getRef' when resolving remotes
  ✔️ should resolve host/target from ids
  ✔️ should resolve separated host/target from ids
  ✔️ should resolve target-pointer from remote host
compile.getRef recursion
  ✔️ should resolve id recursively
  ✔️ should resolve pointer recursively
  ✔️ should resolve remote recursively
json-pointer
  ✔️ should resolve empty token in json-pointer

✔️ test/unit/compile/joinScope.test.ts

joinScope
  ✔️ should add file to domain with folder/
  ✔️ should append id to url
  ✔️ should append id to url/
  ✔️ should join absolute-path-reference
  ✔️ should join domain with folder
  ✔️ should join domain with folder/
  ✔️ should override base root
  ✔️ should replace fragments not ending with slash
  ✔️ should replace id
  ✔️ should replace pointer
  ✔️ should return base without trailing #

✔️ test/unit/compile/splitRef.test.ts

compile.splitRef
  ✔️ should return empty list for empty string
  ✔️ should return empty list for root pointer
  ✔️ should return input id
  ✔️ should return input pointer
  ✔️ should return input pointer from uri fragment
  ✔️ should return sanitized url
  ✔️ should return sanitized url
  ✔️ should return sanitized url and id
  ✔️ should return sanitized url and pointer

✔️ test/unit/compileSchema.test.ts

compile behaviour
  ✔️ should not change iterable properties
  ✔️ should not copy schema twice
  ✔️ should return a copy
  ✔️ should return undefined for missing schema
compile compile ref
  ✔️ should compile ref to absolute scope
  ✔️ should compile ref to absolute scope
  ✔️ should resolve absolute url with subfolder
compile draft04Schema spec remoteRef.json
  ✔️ should correctly replace base uri for remote scope updates
  ✔️ should join scope and resolve to remote
  ✔️ should resolve joined remote with root ref
  ✔️ should resolve ref with remote ref
  ✔️ should resolve remote ref
  ✔️ should resolve remote ref with fragment
compile draft04Schema spec remoteRef.json $ref prevents a sibling id from changing the base uri
  ✔️ $ref resolves to /definitions/base_foo, data does not validate
  ✔️ $ref resolves to /definitions/base_foo, data validates
compile draft04Schema spec remoteRef.json base URI change
  ✔️ base URI change ref invalid
  ✔️ base URI change ref valid
compile draft04Schema spec remoteRef.json base URI change - change folder
  ✔️ number is valid
  ✔️ string is invalid
compile getRef
  ✔️ should always return json-pointer target
  ✔️ should resolve json-pointer with root-url
  ✔️ should return a defined $ref with json-pointer
  ✔️ should return schema defined with referenced ids
  ✔️ should return schema defined with referenced ids from root schema
  ✔️ should return schema defined with referenced ids not using root schema
  ✔️ should return schema for absolute assembled scope ids
compile getRef remote
  ✔️ should resolve id within remote
  ✔️ should resolve pointer within remote
  ✔️ should resolve remotes
  ✔️ should resolve remotes with trailing '#'
compile spec ref.json
  ✔️ should resolve location independent identifier
  ✔️ should resolve location independent identifier with base uri change in subschema
  ✔️ should resolve nested $ref
  ✔️ should resolve pointer containing quotes
  ✔️ should return relative pointer
  ✔️ should return root
  ✔️ should work on escaped pointer

✔️ test/unit/compileSchemaV6.test.ts

compileV06 01 - refRemote base URI change - base URI change ref invalid
  ✔️ should not validate 'object'
  ✔️ should validate 'null'
  ✔️ should validate 'string'
compileV06 02 - refRemote base URI change - base URI change ref invalid
  ✔️ should not validate 'string'
  ✔️ should validate 'number'

✔️ test/unit/createSchemaOf.test.ts

createSchemaOf
  ✔️ should add items from array
  ✔️ should add single item as item-object
  ✔️ should add type 'object' of data to schema
  ✔️ should add type 'string' of data to schema
  ✔️ should should add object's properties

✔️ test/unit/docs/docs.test.ts

docs draft methods
  ✔️ should call for each data point using 'each
  ✔️ should call for each sub schema
  ✔️ should complement data using 'getTemplate'
  ✔️ should resolve from remote schema
  ✔️ should resolve oneOf item using 'getSchema'
  ✔️ should return data using 'getTemplate'
  ✔️ validate should return error
  ✔️ validate should return error for separate schema

✔️ test/unit/docs/remoteSchema.test.ts

docs - remote schema
  ✔️ should resolve $defs from remote schema
  ✔️ should resolve $defs from remote schema using simple ids
  ✔️ should resolve pointer to nested object in remote schema
  ✔️ should resolve remote schema from given url
  ✔️ should resolve remote schemas from simple ids

✔️ test/unit/each.test.ts

each
  ✔️ should call callback with schema, value and pointer
  ✔️ should callback for array and all array items
  ✔️ should callback for array and pick correct schema forEach item
  ✔️ should callback for object and all properties
  ✔️ should resolve root reference

✔️ test/unit/eachSchema.test.ts

eachSchema
  ✔️ should call on additionalProperties
  ✔️ should call on definitions
  ✔️ should call on each allOf-schema
  ✔️ should call on each anyOf-schema
  ✔️ should call on each dependency schema
  ✔️ should call on each item property
  ✔️ should call on each item schema
  ✔️ should call on each oneOf-schema
  ✔️ should call on each oneOf-schema in items
  ✔️ should call on each property schema
  ✔️ should call on each property schema if type is missing
  ✔️ should call on unspecified properties
  ✔️ should execute callback on root-schema
  ✔️ should ignore dependency list
  ✔️ should iterate definitions
  ✔️ should iterate over nested definitions
  ✔️ should support array-types

✔️ test/unit/getChildSchemaSelection.test.ts

getChildSchemaSelection
  ✔️ should resolve items from oneOf elements
  ✔️ should return a single array-item as list
  ✔️ should return a single object-schema as list
  ✔️ should return list of oneOf elements

✔️ test/unit/getSchema.test.ts

getSchema array
  ✔️ should return error if no matching 'oneOf' item was found
  ✔️ should return item schema
  ✔️ should return item schema based on index
  ✔️ should return schema for matching 'oneOf' item
getSchema object
  ✔️ should resolve $ref as property
  ✔️ should return 'one-of-error' if enforced oneOf schema could not be resolved
  ✔️ should return `schema-warning` for unknown, but valid property
  ✔️ should return `undefined` for unknown, but valid property
  ✔️ should return an error for invalid properties
  ✔️ should return an error for invalid properties, even if value is given
  ✔️ should return an error if schema could not be resolved
  ✔️ should return correct 'oneOf' object definition
  ✔️ should return schema for property within nested object
  ✔️ should return schema for unknown property if data is passed
  ✔️ should return schema of matching patternProperty
  ✔️ should return schema of valid property
getSchema object dependencies
  ✔️ should return schema from dependencies when dependent property is present
getSchema object if-then-else
  ✔️ should return correct schema for duplicate property
  ✔️ should return else-schema for non-matching if-schema
  ✔️ should return then-schema for matching if-schema
getSchema value
  ✔️ should resolve property through root $ref
  ✔️ should return schema of any value

✔️ test/unit/getTemplate.test.ts

getTemplate
  ✔️ should not modify input schema
  ✔️ should set an empty string if no default value is given
  ✔️ should set the first enum option for a missing default
  ✔️ should support null type properties
  ✔️ should support null types
getTemplate array items:Array
  ✔️ should convert input data for booleans
  ✔️ should convert input data for numbers
  ✔️ should convert input data for strings
  ✔️ should replace input data
  ✔️ should return default value for invalid boolean
  ✔️ should return default value for invalid number
  ✔️ should return items in given order
getTemplate array items:Object
  ✔️ should extend all input objects by missing properties
  ✔️ should extend given template data by default values
  ✔️ should not override given default values
  ✔️ should return array with minItems
  ✔️ should return default array
  ✔️ should return default array even if minItems is not set
  ✔️ should return default array if part of object
  ✔️ should return empty array if minItems = 0
getTemplate array items.allOf
  ✔️ should create template for merged allOf schema
getTemplate array items.anyOf
  ✔️ should create template for first anyOf schema
getTemplate array items.oneOf
  ✔️ should merge with input data
  ✔️ should not remove invalid oneOf schema if 'removeInvalidData' is unset
  ✔️ should return template of first oneOf schema
getTemplate boolean
  ✔️ should not override given boolean if it is 'false'
  ✔️ should not override given boolean if it is 'true'
  ✔️ should set default value for boolean
getTemplate integer
  ✔️ should not override given integer
  ✔️ should set default value for integer
getTemplate list of types
  ✔️ should return first type of list for template
  ✔️ should return input data
  ✔️ should return type of default value if data is not given
getTemplate number
  ✔️ should not override given number
  ✔️ should set default value for number
getTemplate object $ref
  ✔️ should create template of draft04
  ✔️ should follow $ref once
  ✔️ should resolve $ref in items-array
  ✔️ should resolve $ref in object schema
  ✔️ should respect depth of input data in $ref-resolution
getTemplate object additionalProperties
  ✔️ should not remove additional properties `additionalProperties=true`
  ✔️ should not remove additional properties `additionalProperties=undefined`
  ✔️ should not remove additional properties with `additionalProperties=false`
  ✔️ should not remove non matching properties
  ✔️ should remove invalid properties with option `removeInvalidData=true`
  ✔️ should remove unmatched properties with option `removeInvalidData=true`
getTemplate object allOf
  ✔️ should create template for merged allOf schema
getTemplate object anyOf
  ✔️ should create template for first anyOf schema
getTemplate object dependencies option: `additionalProps: false` dependency required
  ✔️ should add dependency if initially triggered as required
  ✔️ should add dependency if triggered as required
  ✔️ should not add dependency if it is not required
getTemplate object dependencies option: `additionalProps: false` dependency schema
  ✔️ should add dependency from schema if triggered as required
  ✔️ should not add dependency from schema if it is not required
getTemplate object dependencies option: `additionalProps: true`
  ✔️ should create template for valid dependency
  ✔️ should not change passed value of dependency
  ✔️ should not create data for non matching dependency
getTemplate object oneOf
  ✔️ should extend empty object with first oneOf schema
  ✔️ should not require object type definition in oneOf schemas
  ✔️ should return input value if no oneOf-schema matches 
  ✔️ should return template of first oneOf schema
  ✔️ should return template of matching oneOf schema
getTemplate object properties
  ✔️ should extend given template data by default values
  ✔️ should not fail on falsy input data
  ✔️ should not override given default values
  ✔️ should return default object if defined
  ✔️ should return defined properties of object
getTemplate oneOf
  ✔️ should return first schema for mixed types
getTemplate templateOptions
  ✔️ should not add optional properties
  ✔️ should remove invalid oneOf schema if 'removeInvalidData=true'
getTemplate templateOptions extendDefaults
  ✔️ should add items to array with no default-value given and 'extendDefaults:false'
  ✔️ should add items to default-array with 'extendDefaults:true'
  ✔️ should extend default-object with 'extendDefaults:true'
  ✔️ should extend object by required property with no default-value given and 'extendDefaults:false'
  ✔️ should keep array default-value with 'extendDefaults:false'
  ✔️ should not add required items to object with default-value given and 'extendDefaults:false'
getTemplate templateOptions file
  ✔️ should not modify file-instance
  ✔️ should not modify file-instance on object

✔️ test/unit/getTemplate7.test.ts

getTemplate - v7
  ✔️ should prefer const over default
  ✔️ should set const as value
  ✔️ should set default as value
getTemplate - v7 object if-then-else
  ✔️ should incrementally resolve multiple 'then'-schema
  ✔️ should not create data for then-schema if it is not required
  ✔️ should not return template of then-schema for invalid if-schema
  ✔️ should return template of else-schema for invalid if-schema
  ✔️ should return template of then-schema for valid if-schema

✔️ test/unit/getTypeOf.test.ts

getTypeOf
  ✔️ should return 'array' for []
  ✔️ should return 'boolean' for false
  ✔️ should return 'null' for null
  ✔️ should return 'number' for 0
  ✔️ should return 'object' for {}
  ✔️ should return 'regexp' for 'new RegExp()'
  ✔️ should return 'regexp' for /^/
  ✔️ should return 'string' for ""
  ✔️ should return 'undefined' for undefined

✔️ test/unit/issues/issue19.getSchema.dependencies.test.ts

issue#19 - getSchema from dependencies
  ✔️ should return correct schema for existing data property 'customField'
  ✔️ should return correct schema for missing data property 'customField'

✔️ test/unit/issues/issue21.getTemplate.test.ts

issue#21 - getTemplate containing refs
  ✔️ should append property 'runner' on partial objects

✔️ test/unit/issues/issue22.each.test.ts

issue#22 - eachSchema on root $ref
  ✔️ should call for each properties

✔️ test/unit/issues/issue32.getTemplate.integer.test.ts

issue#32 - getTemplate ignored input data for integer
  ✔️ should not override input data

✔️ test/unit/issues/issue33.rootOneOf.test.ts

issue#33 - root oneOf changes type
  ✔️ should return false for root array
issue#33 - root oneOf changes type type array
  ✔️ should return false for root array
  ✔️ should return false for root boolean
  ✔️ should return true for root number
  ✔️ should return true for root string
issue#33 - root oneOf changes type variations
  ✔️ should return false for property array
  ✔️ should return false for property boolean

✔️ test/unit/issues/issue38.getTemplate.anyOf.test.ts

issue#38 - getTemplate anyOf should not modify valid default value
  ✔️ should return valid default value

✔️ test/unit/issues/issue43.multipleOf.float.test.ts

issue#43 - multipleOf .01
  ✔️ should not validate .025
  ✔️ should not validate Infinity
  ✔️ should still invalidate non-multiples of integers
  ✔️ should still validate multiple of integers
  ✔️ should validate .02
  ✔️ should validate .2
  ✔️ should validate 1
  ✔️ should validate 1.36
  ✔️ should validate 123456789
  ✔️ should validate 2.74
  ✔️ should validate all floats with two decimals

✔️ test/unit/issues/issue44.chainedNegLogic.test.ts

issue#44 - chained negative logic
  ✔️ should validate input data

✔️ test/unit/issues/issue57.allOfMutatesData.test.ts

issue#57 - resolveAllOf mutates data
  ✔️ should not modify input data
  ✔️ should not throw an error with a frozen array

✔️ test/unit/isValid.test.ts

isValid
  ✔️ should not validate multiple oneOf validations
  ✔️ should return false if value is invalid
  ✔️ should return true if value is valid

✔️ test/unit/mergeSchema.test.ts

mergeSchema
  ✔️ should merge item property
  ✔️ should merge items of same type
  ✔️ should merge properties
  ✔️ should merge property
  ✔️ should merge required statements
  ✔️ should not merge items of different type
  ✔️ should overwrite items by last argument
  ✔️ should overwrite properties by last argument
  ✔️ should replace items by last argument

✔️ test/unit/reduceSchema.test.ts

reduceSchema allOf
  ✔️ should iteratively resolve allOf before merging (issue#44)
reduceSchema oneOf
  ✔️ should return oneOf source schema for resolved oneOf object

✔️ test/unit/resolveAllOf.test.ts

resolveAllOf
  ✔️ should return merged properties and attributes
  ✔️ should return merged required-list of type object
  ✔️ should return merged schema of type string
  ✔️ should return merged schema while resolving $ref
  ✔️ should return unique merged required-list of type object
resolveAllOf if-then-else
  ✔️ should incrementally resolve multiple 'then'-schema
  ✔️ should merge multiple 'then'-schema
  ✔️ should merge only matching 'if'-schema
  ✔️ should not return 'then'-schema when 'if' does not match
  ✔️ should return 'then'-schema when 'if' does match

✔️ test/unit/resolveDynamicSchema.test.ts

resolveDynamicSchema allOf
  ✔️ should resolve nested allOf schema
  ✔️ should return merged allOf schema
  ✔️ should return undefined if allOf is empty
resolveDynamicSchema anyOf
  ✔️ should return all matching oneOf schema as merged schema
  ✔️ should return matching oneOf schema
  ✔️ should return undefined if anyOf is empty
  ✔️ should return undefined if no anyOf matches input data
resolveDynamicSchema dependencies
  ✔️ should correctly merge dependencies
  ✔️ should resolve nested dependencies schema
  ✔️ should return undefined if dynamic schema is not triggered
resolveDynamicSchema if-then-else
  ✔️ should resolve nested if-then-else schema
  ✔️ should return undefined if dynamic schema is not triggered
  ✔️ should select if-then-else schema
resolveDynamicSchema oneOf
  ✔️ should select correct oneOf schema from oneOfProperty
  ✔️ should select oneOf schema

✔️ test/unit/resolveOneOf.fuzzy.test.ts

resolveOneOf (fuzzy)
  ✔️ should resolve $ref before schema
  ✔️ should return schema with matching pattern
  ✔️ should return schema with matching type
resolveOneOf (fuzzy) array
  ✔️ should return oneOfError for invalid data
resolveOneOf (fuzzy) object
  ✔️ should return schema matching nested properties
  ✔️ should return schema with matching properties
resolveOneOf (fuzzy) object fuzzy match missing values
  ✔️ should find correct pay type
  ✔️ should only count properties that match the schema
  ✔️ should return schema with least missing properties
resolveOneOf (fuzzy) object oneOfProperty
  ✔️ should return an error if no oneOfProperty could be matched
  ✔️ should return an error if value at oneOfProperty is undefined
  ✔️ should return schema matching oneOfProperty
  ✔️ should return schema matching oneOfProperty even it is invalid

✔️ test/unit/resolveOneOf.oneOfProperty.test.ts

oneOfProperty
  ✔️ should return an error if no oneOfProperty could be matched
  ✔️ should return an error if value at oneOfProperty is undefined
  ✔️ should return schema matching oneOfProperty
  ✔️ should return schema matching oneOfProperty even it is invalid

✔️ test/unit/step/step.oneOf.test.ts

step.oneof
  ✔️ should maintain references from a remote schema when resolving oneOf with $ref
  ✔️ should maintain references from a remote schema when resolving oneOf with $ref
  ✔️ should return index of matching schema
  ✔️ should return matching schema

✔️ test/unit/step/step.test.ts

step
  ✔️ should return an error for unknown types
step array
  ✔️ should return a generated schema with additionalItems
  ✔️ should return an error for invalid array schema
  ✔️ should return combined allOf schema
  ✔️ should return combined anyOf schema
  ✔️ should return item at index
  ✔️ should return item property
  ✔️ should return matching anyOf
  ✔️ should return matching item in oneOf
step object
  ✔️ should create schema for `additionalProperties=true`
  ✔️ should resolve references from anyOf schema
  ✔️ should resolve references in allOf schema
  ✔️ should return additionalProperties schema for not matching patternProperty
  ✔️ should return an error if `additionalProperties=false` and property unknown
  ✔️ should return combined anyOf schema
  ✔️ should return error for unknown property
  ✔️ should return error for unknown property
  ✔️ should return matching allOf schema
  ✔️ should return matching anyOf
  ✔️ should return matching oneOf
  ✔️ should return matching oneOf, for objects missing properties
  ✔️ should return matching patternProperty
  ✔️ should return object property
  ✔️ should treat `additionalProperties` as `true` per default

✔️ test/unit/step/step7.allOf.test.ts

step[v7].allOf
  ✖️ should return combined schema

✔️ test/unit/utils/getPrecision.test.ts

getPrecision
  ✔️ should return decimal precision

✔️ test/unit/utils/merge.test.ts

merge
  ✔️ should merge objects
  ✔️ should not modify input values
  ✔️ should replace arrays

✔️ test/unit/validate.format.test.ts

validate format time
  ✔️ should not validate HH:mm
  ✔️ should not validate minutes above 59
  ✔️ should not validate seconds above 59
  ✔️ should validate HH:mm:ss
  ✔️ should validate HH:mm:ss-HH:mm
  ✔️ should validate HH:mm:ss.s
  ✔️ should validate HH:mm:ssZ
validate format url
  ✔️ should return error UrlFormatError for invalid urls
  ✔️ should validate format url

✔️ test/unit/validate.test.ts

validate array
  ✔️ should be valid for matching indices
  ✔️ should return all errors
  ✔️ should return error for invalid index
validate array additionalItems
  ✔️ should also be valid if 'additionalItems' is undefined
  ✔️ should be valid for matching 'additionalItems' schema
  ✔️ should be valid if 'additionalItems' is true
  ✔️ should return error for mismatching 'additionalItems' schema
  ✔️ should return error for prohibited additional items
validate array min/maxItems
  ✔️ should be valid if item count is within range
  ✔️ should return MaxItemsError for too many items
  ✔️ should return MinItemsError for too few items
  ✔️ should still be valid for missing type
validate array not
  ✔️ should be invalid if 'not' keyword does match
validate array oneOf
  ✔️ should return error if no item does match
  ✔️ should return MultipleOneOfError if multiple oneOf definitions match the given value
  ✔️ should return no error for valid oneOf items
validate array uniqueItems
  ✔️ should not validate for duplicated objects
  ✔️ should not validate for duplicated values
  ✔️ should validate for mismatching objects with equal properties
validate arrays of types
  ✔️ should not return an error for a valid type
  ✔️ should return a TypeError if passed type is not within array
  ✔️ should support 'integer' as a valid type within array
validate heterogeneous types $ref
  ✔️ should correctly resolve local remote url
  ✔️ should correctly validate combination of remote, allOf, and allOf-$ref
  ✔️ should correctly validate data through nested $ref
validate heterogeneous types enum
  ✔️ should return error for invalid null
  ✔️ should return error for non-matching object
  ✔️ should validate a matching array within enum
  ✔️ should validate a matching object within enum
  ✔️ should validate a matching value within enum
validate integer
  ✔️ should support type 'integer'
  ✔️ should throw error if type 'integer' received a float
  ✔️ should validate NaN
validate integer allOf
  ✔️ should return all errors for each non-matching schemas
  ✔️ should return error if not all schemas match
  ✔️ should validate if all allOf-schemas are valid
validate integer anyOf
  ✔️ should resolve references
  ✔️ should return error if invalid null
  ✔️ should return error if not all schemas match
  ✔️ should validate if one schemas in anyOf validates
  ✔️ should validate null
validate integer oneOf
  ✔️ should return an error for multiple matching oneOf schemas
  ✔️ should validate on a matching oneOf definition
validate number
  ✔️ should be invalid if 'not' keyword does match
  ✔️ should be valid if 'multipleOf' is not a number
  ✔️ should be valid if number is within range
  ✔️ should be valid if value if a multiple of 1.5
  ✔️ should be valid if value is within enum list
  ✔️ should return EnumError if value is not within enum list
  ✔️ should return error if value is not multiple of 1.5
  ✔️ should return MaximumError if number is too large
  ✔️ should return MaximumError if number same and exclusiveMaximum is set
  ✔️ should return MinimumError if number is equal and exclusiveMinimum is set
  ✔️ should return MinimumError if number is too small
  ✔️ should still be valid for missing type
  ✔️ should validate NaN
validate object
  ✔️ should return all errors
  ✔️ should still be valid for missing type
validate object additionalProperties
  ✔️ should be ignore properties that are matched by patternProperties
  ✔️ should be invalid if value does match multiple 'additionalProperties' in oneOf schema
  ✔️ should be invalid if value does not match 'additionalProperties' in oneOf schema
  ✔️ should be valid if 'additionalProperties' is 'true'
  ✔️ should be valid if value matches 'additionalProperties' oneOf schema
  ✔️ should be valid if value matches 'additionalProperties' schema
  ✔️ should only validate existing definition in 'properties'
  ✔️ should return AdditionalPropertiesError for an additional property
  ✔️ should return all AdditionalPropertiesErrors
  ✔️ should return error if value does not match 'additionalProperties' schema
validate object dependencies
  ✔️ should be valid for a matching schema dependency
  ✔️ should ignore any dependencies if the property is no set
  ✔️ should return a 'MissingDependencyError' if the dependent counterpart is missing
  ✔️ should return a 'MissingDependencyError' if the dependent property is missing
  ✔️ should return validation error for a non-matching schema dependency
validate object min/maxProperties
  ✔️ should be valid if property count is within range
  ✔️ should return MaxPropertiesError for too many properties
  ✔️ should return MinPropertiesError for too few properties
validate object not
  ✔️ should be invalid if 'not' keyword does match
validate object oneOf
  ✔️ should return error for non-matching oneOf
  ✔️ should validate matching oneOf
validate object patternProperties
  ✔️ should invalidate defined property
  ✔️ should return 'PatternPropertiesError' if additional properties are not allowed
  ✔️ should return an AdditionalPropertiesError if additional properties do not validate
  ✔️ should return an error for matching pattern and failed validation
  ✔️ should return an error for matching regex pattern and failed validation
  ✔️ should return an error if one of the matching patterns does not validate
  ✔️ should return no error if additional properties are not allowed but valid in patterns
  ✔️ should return no error if additional properties validate value
  ✔️ should validate a correct matching pattern
validate object required
  ✔️ shoud return errors for missing `required` properties
validate string
  ✔️ should be invalid if 'not' keyword does match
  ✔️ should be valid if string is within range
  ✔️ should be valid if value is within enum list
  ✔️ should return EnumError if value is not within enum list
  ✔️ should return MaxLengthError if string is too long
  ✔️ should return MinLengthError if string is too short
  ✔️ should still be valid for missing type

✔️ test/unit/validateAsync.test.ts

validateAsync
  ✔️ should resolve successfull with an empty error
  ✔️ should resolve with errors for a failed validation
  ✔️ should return a promise
validateAsync onError
  ✔️ should call onProgress immediately with error

✔️ test/unit/validateV7.test.ts

validate draft07 integer exclusiveMaximum
  ✔️ should fail if value is equal to 0
  ✔️ should succeed if value is below to 0
validate draft07 integer exclusiveMinimum
  ✔️ should fail if value is equal to 0
  ✔️ should succeed if value is above to 0
validate draft07 integer if-then-else
  ✔️ should validate if-else constructs
  ✔️ should validate if-then constructs
validate draft07 object dependencies
  ✔️ should return correct error for invalid dependency