Skip to content

feat(#418): Add property-based testing suite with fast-check#439

Merged
Kingsman-99 merged 2 commits into
Stellar-split:mainfrom
levoski1:feat/property-based-testing-418
Jul 24, 2026
Merged

feat(#418): Add property-based testing suite with fast-check#439
Kingsman-99 merged 2 commits into
Stellar-split:mainfrom
levoski1:feat/property-based-testing-418

Conversation

@levoski1

@levoski1 levoski1 commented Jul 23, 2026

Copy link
Copy Markdown

Summary

Adds comprehensive property-based testing suite using fast-check for issue #418.
Closes #418

Changes

  • test/property-roundtrip.test.ts: parseAmount/formatAmount roundtrip properties (8 tests, 500 examples each)
  • test/property-address.test.ts: isValidStellarAddress validation properties (9 tests)
  • test/property-deadline.test.ts: deadlineFromDays computation properties (8 tests)
  • test/property-invoice-params.test.ts: CreateInvoiceParams structure properties (9 tests)
  • test/property-client-invariants.test.ts: StellarSplitClient sequential call invariants (10 tests)

Test Results

  • 44 new property tests, all passing
  • 140 total tests (96 existing + 44 new)
  • passes cleanly
  • All calls use 500+ examples with meaningful failure messages

Properties Verified

  • parseAmount(formatAmount(s)) === s for all valid stroops
  • formatAmount always produces exactly 7 decimal places
  • isValidStellarAddress returns true for all generated keypairs
  • deadlineFromDays produces future timestamps
  • CreateInvoiceParams has valid addresses, amounts, and deadlines
  • formatAmount/parseAmount are deterministic and consistent
  • truncateAddress preserves prefix and suffix
  • isExpired is consistent for past/future deadlines

levibliz and others added 2 commits July 23, 2026 11:22
…heck

- test/property-roundtrip.test.ts: parseAmount/formatAmount roundtrip (8 tests)
- test/property-address.test.ts: isValidStellarAddress properties (9 tests)
- test/property-deadline.test.ts: deadlineFromDays properties (8 tests)
- test/property-invoice-params.test.ts: CreateInvoiceParams properties (9 tests)
- test/property-client-invariants.test.ts: StellarSplitClient invariants (10 tests)
- All tests use fc.assert with 500+ examples and meaningful failure messages
- Added fast-check as dev dependency
- Updated package.json test script to include new property test files
@Kingsman-99
Kingsman-99 merged commit 7f8d0b3 into Stellar-split:main Jul 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement property-based testing suite for the SDK using fast-check

3 participants