Skip to content

Add unit tests for utility functions in utils.ts #4

@adithyaakrishna

Description

@adithyaakrishna

The utils.ts file contains several utility functions that would benefit from unit tests to ensure their correctness and prevent regressions.

Tasks:

  1. Set up a testing framework (e.g., Jest) if not already in place.
  2. Write unit tests for the following functions:
    • toUintArray
    • toUint8Array
    • padU8ToU32Array
    • padArray
    • uint8ArrayToBits
    • bitsToUint8Array
    • uintArrayToBits
    • bitsToUintArray
    • getFullCounterIv
    • getCounterForChunk
  3. Ensure each test covers normal use cases and edge cases.
  4. Add comments explaining the purpose of each test.
  5. Update the project's README with instructions on how to run the tests.

Adding unit tests will improve the reliability of these utility functions and make it easier to maintain and refactor the code in the future.

Contributors: Please note that by submitting a pull request, you are agreeing to accept and sign the Contributor License Agreement (CLA) found at https://github.com/reclaimprotocol/.github/blob/main/CLA.md

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions