Summary
Integrate fast-check for property-based testing alongside the existing example-based Bun test suite.
Motivation
Property-based testing generates random inputs to find edge cases that hand-written examples miss. Good candidates in Unicorn:
attempt() — verify error wrapping holds for arbitrary thrown values (strings, errors, objects, undefined)
- Schema helpers — validate that
snowflakeId, secretString, and config schemas reject/accept arbitrary inputs correctly
- Component pattern matching — verify parameterized ID parsing with arbitrary string patterns
- Guard composition — verify guard chains short-circuit correctly with arbitrary pass/fail combinations
Scope
- Install
fast-check as a dev dependency
- Add property-based tests alongside existing tests (not replacing them)
- Start with
attempt() and schema helpers as initial targets
- Document pattern in
.claude/testing-reference.md
References
Summary
Integrate fast-check for property-based testing alongside the existing example-based Bun test suite.
Motivation
Property-based testing generates random inputs to find edge cases that hand-written examples miss. Good candidates in Unicorn:
attempt()— verify error wrapping holds for arbitrary thrown values (strings, errors, objects, undefined)snowflakeId,secretString, and config schemas reject/accept arbitrary inputs correctlyScope
fast-checkas a dev dependencyattempt()and schema helpers as initial targets.claude/testing-reference.mdReferences