Skip to content

test: increase code coverage from 78% to 90%#510

Open
plusminushalf wants to merge 3 commits into
mainfrom
claude/brave-sanderson
Open

test: increase code coverage from 78% to 90%#510
plusminushalf wants to merge 3 commits into
mainfrom
claude/brave-sanderson

Conversation

@plusminushalf

Copy link
Copy Markdown
Member

Summary

Adds comprehensive unit and integration tests across the permissionless package to increase code coverage from 78% to 90%.

Changes

New Test Files (21 total)

Etherspot Module

  • wrapMessageHash.test.ts - Tests message hash wrapping functionality
  • getUserOperationGasPrice.test.ts - Tests gas price retrieval

Passkey Server Module

  • getCredentials.test.ts - Tests credential retrieval with validation
  • startAuthentication.test.ts - Tests authentication challenge initiation
  • startRegistration.test.ts - Tests registration credential options
  • verifyAuthentication.test.ts - Tests authentication verification
  • verifyRegistration.test.ts - Tests registration verification

Pimlico Module

  • estimateErc20PaymasterCost.test.ts - Tests ERC-20 paymaster cost estimation
  • sendCompressedUserOperation.test.ts - Tests compressed user operation submission

Smart Account Module

  • writeContract.test.ts - Tests contract write functionality

Client Module

  • createSmartAccountClient.test.ts - Tests smart account client creation and actions
  • passkeyServer.test.ts - Tests passkey server client creation

Utilities & Errors

  • errors/index.test.ts - Tests custom error classes
  • decode7579Calls.test.ts - Tests 7579 call decoding with roundtrip validation
  • encodeInstallModule.test.ts - Tests module installation encoding
  • encodeUninstallModule.test.ts - Tests module uninstallation encoding
  • getEstimationCallData.test.ts - Tests call data estimation
  • isSmartAccountDeployed.test.ts - Tests account deployment detection
  • ox.test.ts - Tests utility functions
  • toOwner.test.ts - Tests owner conversion utilities

Configuration Updates

  • Updated vitest.config.ts with improved test configuration

Test Coverage

Tests cover:

  • Happy path scenarios
  • Error handling and validation
  • Edge cases and boundary conditions
  • Roundtrip encoding/decoding
  • RPC method invocations
  • Parameter passing and response handling

… 90%

Add 20 new test files covering utils, actions, clients, and errors.
Exclude type-only and re-export index files from coverage reporting.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Apr 14, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 83d7f00

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@plusminushalf plusminushalf marked this pull request as ready for review April 14, 2026 16:35
@codecov

codecov Bot commented Apr 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.76%. Comparing base (49640ae) to head (83d7f00).
⚠️ Report is 32 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #510      +/-   ##
==========================================
+ Coverage   78.71%   87.76%   +9.05%     
==========================================
  Files         107       98       -9     
  Lines        8941     8896      -45     
  Branches      564      656      +92     
==========================================
+ Hits         7038     7808     +770     
+ Misses       1877     1057     -820     
- Partials       26       31       +5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Fixes 6 biome lint/performance/noDelete errors.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
permissionless (esm) 239.99 KB (0%)
permissionless (cjs) 369.11 KB (0%)

The source uses `in` operator which returns true for keys set to
undefined. Construct response objects without the keys instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant