Description
src/validators/amountValidator.ts has unit tests but no property-based coverage. Add fast-check properties that fuzz fractional precision, leading zeros, and negative sentinels so we catch silent regressions.
Requirements and Context
- Use
fast-check as a devDependency
- Property: any input with >7 fractional digits must reject
- Property: integer-equivalent inputs round-trip
- Must be secure, tested, and documented
- Should be efficient and easy to review
Suggested Execution
- Fork the repo and create a branch
git checkout -b task/amount-validator-pbt
- Implement changes
src/validators/amountValidator.test.ts
package.json
- Test and commit
npm test -- amountValidator
- Cover edge cases (denormalized numbers, NaN strings)
- Include test output and notes in the PR
Example commit message
test: property-based coverage for amount validator
Acceptance Criteria
Guidelines
- Backend (Node/TS): Jest, minimum 90% coverage
- Clear documentation and inline comments
- Timeframe: 96 hours
Description
src/validators/amountValidator.tshas unit tests but no property-based coverage. Addfast-checkproperties that fuzz fractional precision, leading zeros, and negative sentinels so we catch silent regressions.Requirements and Context
fast-checkas a devDependencySuggested Execution
src/validators/amountValidator.test.tspackage.jsonnpm test -- amountValidatorExample commit message
Acceptance Criteria
fast-checkproperties passGuidelines