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

Function validateGeneratedValues

packages/effect/test/Schema/SchemaTest.ts:94–106  ·  view source on GitHub ↗

* Verifies that the schema generates valid arbitrary values that satisfy * the schema.

(schema: Schema.Schema<A, I, R>, options?: {
        readonly params?: FastCheck.Parameters<[A]> | undefined
      })

Source from the content-addressed store, hash-verified

92 * the schema.
93 */
94 validateGeneratedValues<A, I, R>(schema: Schema.Schema<A, I, R>, options?: {
95 readonly params?: FastCheck.Parameters<[A]> | undefined
96 }) {
97 if (config.arbitrary?.validateGeneratedValues?.skip === true) {
98 return
99 }
100 const params = Predicate.isObject(config.arbitrary?.validateGeneratedValues)
101 ? { ...config.arbitrary?.validateGeneratedValues?.params, ...options?.params }
102 : options?.params
103 const is = Schema.is(schema)
104 const arb = Arbitrary.make(schema)
105 FastCheck.assert(FastCheck.property(arb, (a) => is(a)), params)
106 }
107 },
108
109 /**

Callers

nothing calls this directly

Calls 4

isMethod · 0.65
makeMethod · 0.65
assertMethod · 0.65
isFunction · 0.50

Tested by

no test coverage detected