Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Interacting with an Anvil instance #33

Closed Answered by fubhy
gershido asked this question in Q&A
Discussion options

You must be logged in to vote

Your best bet would be to create a TestClient with viem (https://viem.sh/docs/clients/test.html).

Check out the examples here for instance: https://github.com/wagmi-dev/anvil.js/blob/main/examples/example-vitest/tests/utils.ts#L15-L38

There's no increaseTime in those examples, but there's a testClient.reset() call here: https://github.com/wagmi-dev/anvil.js/blob/main/examples/example-vitest/tests/setup.ts#L8-L11

This should all work anaologues in Jest.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by gershido
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants