MCPcopy Create free account
hub / github.com/Effect-TS/effect / verifyGeneration

Function verifyGeneration

packages/effect/test/schema/toArbitrary.test.ts:14–21  ·  view source on GitHub ↗
(schema: S, numRuns?: number)

Source from the content-addressed store, hash-verified

12}
13
14function verifyGeneration<S extends Schema.ConstraintCodec<unknown, unknown>>(schema: S, numRuns?: number) {
15 const asserts = new TestSchema.Asserts(schema)
16 if (numRuns === undefined) {
17 asserts.arbitrary().verifyGeneration()
18 } else {
19 asserts.arbitrary().verifyGeneration({ params: { numRuns } })
20 }
21}
22
23// Guard for "fast but wrong" regressions: samples the derived arbitrary and
24// asserts an output invariant (length/size/property-count bounds) over many runs.

Callers 1

Calls 2

arbitraryMethod · 0.95
verifyGenerationMethod · 0.80

Tested by

no test coverage detected