Coding
PromptBeginner5 minmarkdown
Markdown Converter
Agent skill for markdown-converter
7
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Sign in to like and favorite skills
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
In all interactions, be extremely concise and sacrifice grammar for the sake of concision.
fast-check-frontend is a property-based testing library for UI components that generates and executes random user interaction sequences to verify component invariants. The name means "belt and suspenders" in French, representing redundant safety measures.
src/createInteractionProperty.ts)The library provides a
createInteractionProperty function that integrates fast-check property-based testing with Testing Library user events:
executeInteraction and executeInteractionSequence functions gracefully handle missing DOM elements (log but don't fail)createInteractionProperty accepts:
renderComponent: Function that returns a fresh HTMLElementinvariants: Array of sync/async predicates to check after interaction sequencesoptions: Configure sequence length (min/max)examples/react/)A React signup form (
SignupForm.tsx) demonstrates the library usage:
SignupForm.test.tsx) verifies three invariants under random interactions:
cd examples/react pnpm install pnpm dev # Start Vite dev server pnpm build # TypeScript compile + Vite build pnpm lint # Run ESLint pnpm test # Run Vitest tests
# From examples/react directory pnpm test # Run all tests in watch mode pnpm test -- --run # Run tests once (CI mode) pnpm test -- SignupForm # Run specific test file
/src/createInteractionProperty.ts # Main library code /examples/react/ # React example implementation src/SignupForm.tsx # Complex form component src/SignupForm.test.tsx # Property test using the library src/App.tsx # Demo app entry