Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

write test for utils/scaffold-stark/common.ts #387

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Benjtalkshow
Copy link

@Benjtalkshow Benjtalkshow commented Dec 13, 2024

[TEST] Create unit tests for utils/scaffold-stark/common.ts file

Fixes #372

Types of change

  • Enhancement

Test covers

  • Conversion of BigInt values to strings.
  • Handling of non-BigInt values (returning them as-is).
  • Validation of correct Ethereum addresses (40 hexadecimal characters with '0x' prefix).
  • Rejection of invalid addresses (wrong length, missing prefix, invalid characters).
  • Conversion of non-zero BigInt values to hexadecimal strings.
  • Handling of zero as a BigInt.
  • Validation of correct JSON strings (objects, arrays, and simple values).
  • Rejection of invalid JSON strings (malformed JSON, non-JSON strings, empty strings).
  • Test
    image
  • Test coverage
    image

@Benjtalkshow
Copy link
Author

@metalboyrick
Please review.

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.

[TEST] Create unit tests for utils/scaffold-stark/common.ts file
1 participant