Skip to content

Add unit tests for the useFormatXlm hook handling bigint inputs without precision loss #645

Description

@Chucks1093

Summary

The useFormatXlm hook accepts both number and bigint inputs, but bigint handling has no specific test coverage. Very large bigint values that exceed JavaScript's safe integer range must be formatted without precision loss or scientific notation.

Scope

  • Test a bigint value within safe integer range formats identically to the equivalent number
  • Test a bigint value above Number.MAX_SAFE_INTEGER formats without precision loss
  • Test a bigint value of 0n returns 0.00
  • Test a negative bigint (if supported) returns a negative formatted string or throws a clear error

Acceptance Criteria

  • Safe-range bigint formats identically to equivalent number
  • Above-safe-range bigint formatted without precision loss
  • 0n returns 0.00
  • Behaviour for negative bigint is defined and tested

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions