test: increase code coverage from 78% to 90%#510
Conversation
… 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>
|
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
Fixes 6 biome lint/performance/noDelete errors. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
size-limit report 📦
|
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>
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 functionalitygetUserOperationGasPrice.test.ts- Tests gas price retrievalPasskey Server Module
getCredentials.test.ts- Tests credential retrieval with validationstartAuthentication.test.ts- Tests authentication challenge initiationstartRegistration.test.ts- Tests registration credential optionsverifyAuthentication.test.ts- Tests authentication verificationverifyRegistration.test.ts- Tests registration verificationPimlico Module
estimateErc20PaymasterCost.test.ts- Tests ERC-20 paymaster cost estimationsendCompressedUserOperation.test.ts- Tests compressed user operation submissionSmart Account Module
writeContract.test.ts- Tests contract write functionalityClient Module
createSmartAccountClient.test.ts- Tests smart account client creation and actionspasskeyServer.test.ts- Tests passkey server client creationUtilities & Errors
errors/index.test.ts- Tests custom error classesdecode7579Calls.test.ts- Tests 7579 call decoding with roundtrip validationencodeInstallModule.test.ts- Tests module installation encodingencodeUninstallModule.test.ts- Tests module uninstallation encodinggetEstimationCallData.test.ts- Tests call data estimationisSmartAccountDeployed.test.ts- Tests account deployment detectionox.test.ts- Tests utility functionstoOwner.test.ts- Tests owner conversion utilitiesConfiguration Updates
vitest.config.tswith improved test configurationTest Coverage
Tests cover: