Overview
Add property-based tests using fast-check that verify SDK invariants hold for arbitrary inputs. This goes beyond unit tests by generating hundreds of random inputs per property and shrinking failures to minimal reproducible cases.
Requirements
- Install
fast-check as a dev dependency
- Write property tests for:
parseAmount / formatAmount roundtrip: formatAmount(parseAmount(x)) === x for all valid USDC strings
isValidAddress: any 56-char G-prefixed base32 string passes; anything else fails
deadlineFromDays(n) > Date.now() / 1000 for all n > 0
createInvoice parameters: arbitrary recipient counts (1–20), amounts summing to any positive value
StellarSplitClient methods: sequential call sequences never leave the client in an inconsistent state (using a mock contract)
- Each property must run at least 500 examples
- All properties must have meaningful
fc.assert failure messages for debugging
Acceptance Criteria
Definition of Done
All CI checks must pass before the PR is reviewed.
Overview
Add property-based tests using
fast-checkthat verify SDK invariants hold for arbitrary inputs. This goes beyond unit tests by generating hundreds of random inputs per property and shrinking failures to minimal reproducible cases.Requirements
fast-checkas a dev dependencyparseAmount/formatAmountroundtrip:formatAmount(parseAmount(x)) === xfor all valid USDC stringsisValidAddress: any 56-char G-prefixed base32 string passes; anything else failsdeadlineFromDays(n) > Date.now() / 1000for alln > 0createInvoiceparameters: arbitrary recipient counts (1–20), amounts summing to any positive valueStellarSplitClientmethods: sequential call sequences never leave the client in an inconsistent state (using a mock contract)fc.assertfailure messages for debuggingAcceptance Criteria
fast-checkinstalled and configurednpm testpasses with zero failuresDefinition of Done
All CI checks must pass before the PR is reviewed.