Practical overview
When it fits
Use it when tests need controlled Ethereum provider states or simulated blockchain interactions, particularly in applications with wallet connections or contract calls.
Who it is for
- Developers testing applications that consume Ethereum providers.
- Teams writing tests for wallet connections or contract interactions.
Documented uses
- Simulate connected, disconnected, or read-only provider states.
- Test application responses to provider and blockchain interactions.
- Exercise contract-facing application behavior without tying the core mocks to one Ethereum interaction library.
Requirements & limits
The repository identifies the project as MIT licensed and recommends installing it as a development dependency. Its README states that the repository is no longer maintained.
- The core mocks are described as independent of the Ethereum interaction library used by the application.
- Provider injection must follow the application's own implementation; the README demonstrates
window.ethereumfor MetaMask. - The README recommends clearing mocks between tests.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Set up a mock provider in a test
Install Eth Testing and prepare a mock provider for an application test.
Before you start
- An application test environment.
- npm or Yarn.
Steps
Install
eth-testingas a development dependency with npm or Yarn.Call
generateTestingUtilswith a documented provider type such asMetaMask.Inject the provider returned by
getProvider()where the application expects its Ethereum provider; the README's MetaMask example useswindow.ethereum.Clear mock state between tests with
clearAllMocks, as shown in the README's Jest example.
Expected outcome
The test environment has a generated mock Ethereum provider and a documented way to clear its mocks between tests.
Guide limitations
- Provider injection depends on the application's implementation.
- The repository states that it is no longer maintained.
Choose a simulated wallet or provider state
Configure a mock state for application tests that depend on Ethereum provider responses.
Before you start
- Eth Testing installed as a development dependency.
- Testing utilities generated with
generateTestingUtils.
Steps
Choose a documented high-level mock:
mockReadonlyProvider,mockNotConnectedWallet, ormockConnectedWallet.For a connected wallet, pass the accounts to
mockConnectedWallet; use its options to set chain ID or block number when needed.Run the application test against the configured provider state and clear mocks between tests.
Expected outcome
Tests can exercise application behavior with a selected read-only, disconnected-wallet, or connected-wallet provider state.
Guide limitations
- The repository is no longer maintained.
- The README describes the mock states and examples but does not establish compatibility with every application or test setup.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 15 October 2026
- Original website title
- VGLoic/eth-testing-monorepo · Official homepage title · retained in its source language

