Skip to content

chore: tests#34

Merged
pedrocrvz merged 4 commits into
masterfrom
chore/tests
Feb 13, 2026
Merged

chore: tests#34
pedrocrvz merged 4 commits into
masterfrom
chore/tests

Conversation

@pedrocrvz

Copy link
Copy Markdown
Contributor

No description provided.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @pedrocrvz, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly overhauls the project's testing infrastructure by migrating to Vitest. It introduces a robust suite of unit tests and mocking helpers for various core functionalities, including account actions, bundler interactions, relayer operations, and WebSocket management. The integration also includes pre-commit hooks to enforce testing, ensuring that new changes adhere to quality standards. This effort aims to improve the reliability and maintainability of the codebase.

Highlights

  • Testing Framework Migration: Introduced Vitest as the new testing framework, replacing previous setups and adding comprehensive test configurations.
  • Enhanced Test Coverage: Added a substantial number of new unit tests and mocking utilities across account, bundler, relayer, utility, and WebSocket modules.
  • Pre-commit Test Enforcement: Configured a new pre-commit hook using lefthook.yml to automatically run tests before commits, ensuring code quality.
  • Dependency Updates: Updated pnpm-lock.yaml to reflect the new Vitest-related dependencies and removed zod from the root catalog.
  • Build Process Refinement: Excluded test-related files and directories from the main build process to maintain a clean production bundle.
Changelog
  • examples/relayer/ws/src/global.ts
    • Removed redundant data.receipt from console log in success callback.
  • lefthook.yml
    • Added a pre-commit hook to run pnpm run test.
  • package.json
    • Added a new test script (pnpm -r test).
    • Updated dev dependencies to include vitest and @vitest/coverage-v8.
  • pnpm-lock.yaml
    • Updated the lockfile to reflect new vitest dependencies.
    • Removed zod from the root catalog.
  • src/test/helpers/fixtures.ts
    • Added shared test fixtures for addresses, hashes, and RPC response statuses.
  • src/test/helpers/mockSmartAccount.ts
    • Added a utility to create a mock SmartAccount instance.
  • src/test/helpers/mockTransport.ts
    • Added utilities to create mock Viem Transport and Client instances.
  • src/test/helpers/mockWebSocket.ts
    • Added utilities to create mock InternalSubscription and WebSocketManager instances.
  • src/account/actions/getFeeQuote.test.ts
    • Added unit tests for the getFeeQuote action.
  • src/account/actions/sendTransaction.test.ts
    • Added unit tests for the sendTransaction action.
  • src/account/actions/sendTransactionSync.test.ts
    • Added unit tests for the sendTransactionSync action.
  • src/bundler/actions/estimateUserOperationGas.test.ts
    • Added unit tests for the estimateUserOperationGas action.
  • src/bundler/actions/getUserOperationGasPrice.test.ts
    • Added unit tests for the getUserOperationGasPrice action.
  • src/bundler/actions/getUserOperationQuote.test.ts
    • Added unit tests for the getUserOperationQuote action.
  • src/bundler/actions/prepareUserOperation.test.ts
    • Added unit tests for the prepareUserOperation action.
  • src/bundler/actions/sendUserOperation.test.ts
    • Added unit tests for the sendUserOperation action.
  • src/bundler/actions/sendUserOperationSync.test.ts
    • Added unit tests for the sendUserOperationSync action.
  • src/bundler/actions/waitForUserOperationReceipt.test.ts
    • Added unit tests for the waitForUserOperationReceipt action.
  • src/package.json
    • Added vitest and @vitest/coverage-v8 as dev dependencies.
    • Added new test scripts (test, test:watch, test:coverage).
  • src/relayer/evm/actions/getCapabilities.test.ts
    • Added unit tests for the getCapabilities action.
  • src/relayer/evm/actions/getFeeData.test.ts
    • Added unit tests for the getFeeData action.
  • src/relayer/evm/actions/getFeeQuote.test.ts
    • Added unit tests for the getFeeQuote action.
  • src/relayer/evm/actions/getGelatoStatus.test.ts
    • Added unit tests for the getGelatoStatus action.
  • src/relayer/evm/actions/getStatus.test.ts
    • Added unit tests for the getStatus action.
  • src/relayer/evm/actions/sendTransaction.test.ts
    • Added unit tests for the sendTransaction action.
  • src/relayer/evm/actions/sendTransactionSync.test.ts
    • Added unit tests for the sendTransactionSync action.
  • src/relayer/evm/actions/waitForReceipt.test.ts
    • Added unit tests for the waitForReceipt action.
  • src/tsconfig.build.json
    • Excluded the __test__ directory from the build.
  • src/utils/errors.test.ts
    • Added unit tests for custom error classes and RPC error handling.
  • src/utils/payment.test.ts
    • Added unit tests for the appendPayment utility.
  • src/utils/serialize.test.ts
    • Added unit tests for serialization utilities.
  • src/utils/withTimeout.test.ts
    • Added unit tests for the withTimeout utility.
  • src/vitest.config.ts
    • Added a new Vitest configuration file.
  • src/ws/errors.test.ts
    • Added unit tests for WebSocket error classes.
  • src/ws/manager.test.ts
    • Added unit tests for the WebSocket manager.
  • src/ws/subscription.test.ts
    • Added unit tests for WebSocket subscription handling.
  • src/ws/waitForTerminalStatus.test.ts
    • Added unit tests for waiting on terminal WebSocket status.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/ci.yml
Activity
  • The pull request author, pedrocrvz, initiated a significant refactoring effort to introduce Vitest as the primary testing framework.
  • A large number of new test files and mocking utilities were created, indicating a strong focus on improving the robustness and testability of the codebase.
  • The integration of a pre-commit hook for running tests suggests a commitment to maintaining high code quality and preventing regressions.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a comprehensive test suite using vitest, covering account, bundler, and relayer actions, as well as various utility functions. The setup includes new test scripts, pre-commit hooks, and a vitest configuration, which significantly improves the project's code quality and maintainability. The tests are well-structured with good mocking strategies. I've found one minor issue in a newly added test case that seems to be a copy-paste error, and I've provided a suggestion to fix it. Overall, this is an excellent contribution.

Comment thread src/utils/serialize.test.ts
@pedrocrvz
pedrocrvz merged commit 0d3865e into master Feb 13, 2026
2 checks passed
@pedrocrvz
pedrocrvz deleted the chore/tests branch February 13, 2026 15:54
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