MCPcopy Index your code
hub / github.com/Effect-TS/effect / expectProperty

Function expectProperty

packages/effect/test/Schema/JSONSchema.test.ts:21–33  ·  view source on GitHub ↗
(
  schema: Schema.Schema<A, I>,
  jsonSchema: JSONSchema.JsonSchema7,
  params?: fc.Parameters<[I]>
)

Source from the content-addressed store, hash-verified

19 new Ajv.default(ajvOptions).compile(jsonSchema)
20
21const expectProperty = <A, I>(
22 schema: Schema.Schema<A, I>,
23 jsonSchema: JSONSchema.JsonSchema7,
24 params?: fc.Parameters<[I]>
25) => {
26 if (false as boolean) {
27 const encodedBoundSchema = Schema.encodedBoundSchema(schema)
28 const arb = A.make(encodedBoundSchema)
29 const is = Schema.is(encodedBoundSchema)
30 const validate = getAjvValidate(jsonSchema)
31 fc.assert(fc.property(arb, (i) => is(i) && validate(i)), params)
32 }
33}
34
35const expectJSONSchema = <A, I>(
36 schema: Schema.Schema<A, I>,

Callers 1

expectJSONSchemaPropertyFunction · 0.70

Calls 6

getAjvValidateFunction · 0.70
makeMethod · 0.65
isMethod · 0.65
assertMethod · 0.65
isFunction · 0.50
validateFunction · 0.50

Tested by

no test coverage detected