Variable toMatchJsonSchemaConst
toMatchJsonSchema: (
instance: any,
uriOrSchema: string | boolean | SchemaObject,
) => AsyncExpectationResult = matchJsonSchema
Type declaration
- (
instance: any,
uriOrSchema: string | boolean | SchemaObject,
): AsyncExpectationResult Parameters
- instance: any
- uriOrSchema: string | boolean | SchemaObject
Returns AsyncExpectationResult
A vitest matcher that can be used to validate a JSON-compatible value. It can take a relative or full URI for a schema in your codebase. Use relative URIs to reference a file and full URIs to reference the
$id
of a schema you registered using theregisterSchema
function.You can use this matcher with an inline schema as well, but you will only get coverage for schemas that are in files.