effect-arbitrary
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseEffect Arbitrary
Effect Arbitrary
Generate values from an Effect Schema.
ts
import { Schema } from "effect"
import { FastCheck } from "effect/testing"
const samples = FastCheck.sample(Schema.toArbitrary(schema)(FastCheck), 10)Default-export the schema from a module. Run the CLI:
sh
bun apps/effect-arbitrary/generate.ts <schema-module> --count 10从Effect Schema生成值。
ts
import { Schema } from "effect"
import { FastCheck } from "effect/testing"
const samples = FastCheck.sample(Schema.toArbitrary(schema)(FastCheck), 10)从模块中默认导出schema。运行CLI命令:
sh
bun apps/effect-arbitrary/generate.ts <schema-module> --count 10