Category: Software, github

by No matter how much user research you conduct or how thick the font-weight is on your input label, you can never be certain how users will interact with your product.

So we need a way to test our software to withstand an unlimited number of potential user flows.That’s where property-based testing comes in.Within this guide, we’ll explain the must-knows of property-based testing in JavaScript.

But before going any further, let's talk about why you would want to integrate property-based testing into your workflow.Nicolas Dubien, the creator of the fast-check framework we're exploring in this guide, wrote a post outlining the primary benefits of property-based testing.To summarize his words, property-based testing enables developers to: In this guide, we'll focus on that first benefit: Covering the entire scope of possible inputs.

At first, running hundreds of test cases might feel excessive - but these numbers are reasonable (and even considered low) in the property-based testing realm.Going back to the example test, you can peek at the generated input values using fast-check's sample function.

Related Articles