From 48711ef64611f6ff6197edf3858d214002a5966c Mon Sep 17 00:00:00 2001 From: Ryan Goree Date: Tue, 17 Dec 2024 22:20:57 -0600 Subject: [PATCH] Fix test warnings --- packages/drift/src/adapter/MockAdapter.test.ts | 7 ++++--- packages/drift/src/client/MockClient.test.ts | 2 +- packages/drift/src/client/contract/Contract.test.ts | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/drift/src/adapter/MockAdapter.test.ts b/packages/drift/src/adapter/MockAdapter.test.ts index 47e4b42..06f212b 100644 --- a/packages/drift/src/adapter/MockAdapter.test.ts +++ b/packages/drift/src/adapter/MockAdapter.test.ts @@ -195,9 +195,10 @@ describe("MockAdapter", () => { describe("waitForTransaction", () => { it("Resolves to undefined by default", async () => { const adapter = new MockAdapter(); - expect( - adapter.waitForTransaction({ hash: "0x" }), - ).resolves.toBeUndefined(); + const result = await adapter + .waitForTransaction({ hash: "0x" }) + .catch(() => "error"); + expect(result).toBeUndefined(); }); it("Can be stubbed with specific params", async () => { diff --git a/packages/drift/src/client/MockClient.test.ts b/packages/drift/src/client/MockClient.test.ts index 539f325..cb60117 100644 --- a/packages/drift/src/client/MockClient.test.ts +++ b/packages/drift/src/client/MockClient.test.ts @@ -203,7 +203,7 @@ describe("MockClient", () => { describe("waitForTransaction", () => { it("Resolves to undefined by default", async () => { const client = new MockClient(); - expect( + await expect( client.waitForTransaction({ hash: "0x" }), ).resolves.toBeUndefined(); }); diff --git a/packages/drift/src/client/contract/Contract.test.ts b/packages/drift/src/client/contract/Contract.test.ts index aed09d2..489d923 100644 --- a/packages/drift/src/client/contract/Contract.test.ts +++ b/packages/drift/src/client/contract/Contract.test.ts @@ -46,6 +46,6 @@ describe("Contract", () => { expect(await contract.read("symbol")).toBe("DAI"); contract.invalidateRead("symbol"); - expect(contract.read("symbol")).rejects.toThrow(); + await expect(contract.read("symbol")).rejects.toThrow(); }); });