diff --git a/test/mock-contract.test.ts b/test/mock-contract.test.ts index 0990bea..49f92e2 100644 --- a/test/mock-contract.test.ts +++ b/test/mock-contract.test.ts @@ -122,6 +122,27 @@ describe("Doppelganger", function () { } }); + it("Should allow undefined call.inputs for read calls", async function () { + const [signer] = await hre.viem.getWalletClients(); + const reader = await hre.viem.getPublicClient(); + + const mock = await deployMock(signer, reader); + await mock.setup>({ + kind: "read", + abi: erc20ABI[0], + outputs: [100n], + }); + + expect( + await reader.readContract({ + address: mock.address, + abi: erc20ABI, + functionName: "balanceOf", + args: [zeroAddress], + }), + ).to.equal(100n); + }); + // TODO: it.skip("Should allow for the mocking of events", async function () {}); });