Skip to content

test: improve test case naming across packages#413

Open
0x471 wants to merge 1 commit into
zk-kit:mainfrom
0x471:test/improve-test-naming
Open

test: improve test case naming across packages#413
0x471 wants to merge 1 commit into
zk-kit:mainfrom
0x471:test/improve-test-naming

Conversation

@0x471

@0x471 0x471 commented Jan 23, 2026

Copy link
Copy Markdown
Contributor

Description

This PR improves test case descriptions to be more precise, accurate, and consistent
All changes are name-only, no test logic was modified

Related Issue(s)

Closes #158

Checklist

  • I have read and understand the contributor guidelines and code of conduct.
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have run yarn style without getting any errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR standardizes and clarifies unit test case titles across multiple zk-kit packages to improve readability and consistency (per #158), without changing test logic.

Changes:

  • Updated it(...)/test(...) descriptions across utils, cryptography, and Merkle tree-related packages to be more precise and behavior-focused.
  • Improved wording for invalid-parameter / error-condition tests to better reflect expected outcomes (e.g., “should throw”, “should not verify”).
  • Normalized phrasing in several suites to reduce ambiguity and improve consistency.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/utils/tests/scalars.test.ts Refined scalar helper test titles to describe expected behavior more explicitly.
packages/utils/tests/f1-field.test.ts Reworded finite-field operation test titles for clarity (add/sub/mul/div/etc.).
packages/utils/tests/crypto.test.ts Clarified getRandomValues test title to specify size-driven behavior.
packages/utils/tests/conversions.test.ts Corrected/improved conversion-related test titles (hex/base64/endian conversions).
packages/smt/tests/utils.test.ts Improved utility test titles for SMT key/path and array helper behaviors.
packages/smt/tests/index.test.ts Adjusted SMT test titles for root-hash and invalid-proof phrasing.
packages/poseidon-proof/tests/index.test.ts Standardized PoseidonProof test titles; clarified invalid-proof expectation.
packages/poseidon-cipher/tests/utils.test.ts Made utils test titles more descriptive (determinism, pow5, normalize, conversions).
packages/poseidon-cipher/tests/index.test.ts Improved cipher test titles to reflect plaintext/ciphertext behavior precisely.
packages/logical-expressions/tests/index.test.ts Reworded logical expression test titles to be shorter and behavior-driven.
packages/lean-imt/tests/lean-imt.test.ts Updated LeanIMT test titles to better match error cases and expected outcomes.
packages/lazytower/tests/index.test.ts Clarified LazyTower proof-building test titles to distinguish scenarios.
packages/imt/tests/imt.test.ts Improved IMT test titles for invalid init, full-tree insert, proof creation, and “no throw” cases.
packages/eddsa-poseidon/tests/eddsa-poseidon-blake2.test.ts Updated Blake2b test titles to be more explicit and consistent.
packages/eddsa-poseidon/tests/eddsa-poseidon-blake1.test.ts Refined EdDSA Poseidon (Blake-1) test titles for correctness/consistency.
packages/baby-jubjub/tests/index.test.ts Updated BabyJubjub test titles; one title needs adjustment for semantic accuracy.
Comments suppressed due to low confidence (1)

packages/baby-jubjub/tests/index.test.ts:15

  • The test title is semantically incorrect/unclear: you’re not “adding the base point to the subgroup” (subgroups aren’t something you add points to). This test is validating addPoint (with the identity point and Base8) matches circomlib’s addPoint. Consider renaming the test to describe point addition (or equivalence with circomlibjs) more directly.
    it("Should add the base point to the subgroup", async () => {
        const p1: Point<bigint> = [BigInt(0), BigInt(1)]

        const newPoint = addPoint(p1, Base8)
        const circomlibNewPoint = babyjub.addPoint(p1, Base8)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

Write better test cases titles

2 participants