CodeVetter · Repo Unpack · Behavior traces
dubzzz/fast-check
Source reads followed ordinary assertion, failure replay, worker-backed assertion, and framework registration through their output boundaries. Additional traces cover sampling, model commands, scheduler release, and website onboarding. These are execution-order reconstructions from source, not observed runtime results. The replay flow reconstructs a failure from seed/path rather than loading persisted execution objects.
- Assertion flow: asyncProperty → PropertyImplem(tuple(...)) → assert → check → read(parameters) → plugin construction/decoration → toss → SourceValuesIterator → runIt → RunnerIterator; runIt awaits each predicate and feeds its result back before advancing.
- Failure flow: PropertyImplem.run converts an error/false result → RunnerIterator.handleResult calls RunExecution.fail → the iterator switches to property.shrink → each further failure extends the path; endOnFailure substitutes an empty shrink iterator before execution.
- Replay flow: check with a nonempty path → lazyToss → pathWalk parses colon-separated indices → drops initial producers → generates the selected value → repeatedly shrinks and drops candidates → ordinary execution; RunExecution.mergePaths incorporates the starting offset.
- Worker flow: propertyFor → workerProperty → runMainThread selects a pool/builds the property → worker assert injects the worker plugin → beforeEach acquires a lock and worker → register/postMessage → runWorker executes the predicate → response resolves the run → assert finally invokes associated pool cleanup; file-scoped pools may defer actual worker termination.
- Vitest .prop flow: buildTest exposes .prop → buildTestProp selects tuple or record conversion → buildTestWithPropRunner selects a seed and creates asyncProperty → registered callback collects suite hooks and adds lifecycle plugins → awaited fc.assert executes the property.
- Sampling flow: sample → streamSample merges parameters → toProperty wraps the input → toss or replay pathWalk → take(numRuns) → value_ extraction → array materialization; statistics consumes that stream and emits sorted category percentages.
- Model/scheduler flow: asyncModelRun → internalAsyncModelRun → setup → genericModelRun chains commands → await command.check → conditionally await command.run; scheduledModelRun wraps commands, schedules startModel, then waits for the model and all remaining scheduler tasks.
- Website onboarding flow: Home renders HomepageHeader and feature content → Quick Start links to basic-setup → the guide scaffolds a tutorial with degit → identifies sort.mjs/sort.test.mjs and Vitest → instructs npm test; homepage example demonstrates awaited assert(asyncProperty(...)).