CodeVetter · Repo Unpack · Extension points
dubzzz/fast-check
Most extension mechanisms are typed APIs and composable factories. Arbitraries define generation and shrinking, plugins wrap execution, and custom RNG factories control randomness. Commands and scheduler hooks adapt testing to stateful or asynchronous systems. Documentation and build configuration provide additional repository-level extension surfaces.
- Custom Arbitrary<T> implementations provide generate, canShrinkWithoutContext, and shrink, returning Value objects with context; new public generators are explicitly exported through fast-check.ts.
- Arbitrary.filter, map, and chain are composition factories; map accepts an optional unmapper for user-provided values, while chain retains original/chained shrink context and cloned randomness.
- Plugin builders receive their execution index and a shared symbol-keyed PluginStore; instances can implement decorateGenerate, decorateRun, onAllRunsComplete, and afterAll.
- installGlobalPlugin registers outer wrappers for every runner, while per-call plugins remain local; reporting plugins can throw in onAllRunsComplete to override default assertion reporting, and the older reporter option remains supported.
- randomType accepts a seeded generator factory; qualification validates exposed min/max bounds and adapts generators when needed, allowing alternatives to the default xorshift128plus.
- Model runners accept user setup functions and iterable commands with check/run behavior; SchedulerImplem accepts a cloneable TaskSelector and act function, with additional customAct wrappers per scheduled task or wait.
- Generated objects can expose cloneMethod for repeatable access and toStringMethod/asyncToStringMethod for custom diagnostic serialization; Value and stringify explicitly dispatch through those contracts.
- Repository extensions can reuse buildConfigFor with package export mappings; website documentation is discovered through an autogenerated sidebar, and Docusaurus plugins add PWA, TypeDoc, and LLM-readable documentation outputs.