Settings

Theme

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

github.com

1 points by damnhotuser 2 months ago · 0 comments · 1 min read

Reader

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.

No comments yet.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection