0.2.0 • Published 1 year ago

ganache-testcontainers v0.2.0

Weekly downloads
-
License
MPL-2.0
Repository
github
Last release
1 year ago

This project is part of the Chainfile ecosystem; it provides a Docker image for running Ganache in a container for toolchain isolation.

npm i -D ganache-testcontainers viem
import { afterAll, beforeAll, expect, it } from '@workspace/jest/globals';

import { GanacheClient, GanacheContainer, StartedGanacheContainer } from './index';

let container: StartedGanacheContainer;

beforeAll(async () => {
  container = await new GanacheContainer().start();
});

afterAll(async () => {
  await container.stop();
});

it('should rpc(eth_blockNumber) via viem', async () => {
  const client: GanacheClient = container.client;
  const blockNumber = await client.getBlockNumber();
  expect(blockNumber).toBeGreaterThanOrEqual(0n);
});
0.2.0

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago

0.0.0

1 year ago