Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
steezeburger committed Nov 26, 2024
1 parent 66de108 commit fb204b7
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,11 @@ describe("AstriaWithdrawerService and AstriaErc20WithdrawerService", () => {
const mockTxHash = "0xabcdef0123456789" as const;

const mockWalletClient = {
writeContract: jest
.fn()
.mockImplementation(() => Promise.resolve(mockTxHash)),
writeContract: jest.fn().mockReturnValue(Promise.resolve(mockTxHash)),
};

const mockPublicClient = {
readContract: jest.fn().mockImplementation(() => Promise.resolve(1000000)),
readContract: jest.fn().mockReturnValue(Promise.resolve(1000000)),
};

const mockWagmiConfig = {
Expand All @@ -43,6 +41,10 @@ describe("AstriaWithdrawerService and AstriaErc20WithdrawerService", () => {

beforeEach(() => {
jest.resetAllMocks();

mockWalletClient.writeContract.mockReturnValue(Promise.resolve(mockTxHash));
mockPublicClient.readContract.mockReturnValue(Promise.resolve(1000000));

(getWalletClient as jest.Mock).mockResolvedValue(mockWalletClient);
(getPublicClient as jest.Mock).mockReturnValue(mockPublicClient);
});
Expand Down

0 comments on commit fb204b7

Please sign in to comment.