test: improve test case naming across packages#413
Open
0x471 wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
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 andBase8) matches circomlib’saddPoint. 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
yarn stylewithout getting any errors