Apply Property Based Testing

Use when a function or module has an invariant that should hold across a wide range of inputs — not just the handful of specific cases an example-based test happens to cover — such as "encoding then decoding always returns the original value" or "sorting a list never changes its length"; generate many random inputs, assert the invariant holds for all of them, and let the framework automatically shrink any failing case to a minimal reproduction.

jeffreytse Updated
grimoire

File contents

jeffreytse/grimoire-core commit 23d33b763c

Frequently asked questions

npx get-skill add jeffreytse/apply-property-based-testing