Show HN: fast-check-frontend – Property-based testing for UI components

Hey there,

Since I learned about property-based testing a couple of years ago, I always wondered: whouldn't it be a nice fit for testing unpredictable systems such as frontend components?

Most of the bugs we stumble upon as frontend devs are related to usecases we did not think about while developing our components, or while testing it. The idea of fast-check-frontend is basically to generate sequences of random (yet customizable) user interactions (clicks, keyboards events, scrolls, hovers, etc...), to dispatch them to DOM elements, and to validate invariants (things that should always be true after interactions).

The lib is framework agnostic, should work with any test-runner (only tried with Jest yet), and relies on the shoulder giants: fast-check and @testing-library.

This is still WIP, but any constructive feedbacks would still be appreciated.

1 points damnhotuser 11 months ago 0 comments

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton