Skip to content

Commit

Permalink
test: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseRFelix committed Jun 8, 2024
1 parent 8f08f21 commit 6ed3cb1
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions packages/bridge/src/axelar/__tests__/axelar-transfer-status.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,25 @@ import { BridgeEnvironment, TransferStatusReceiver } from "../../interface";
import { TransferStatus } from "../queries";
import { AxelarTransferStatusProvider } from "../transfer-status";

jest.mock("@osmosis-labs/utils", () => ({
poll: jest.fn(({ fn, validate }) => {
const pollFn = async () => {
const result = await fn();
if (validate(result)) {
return result;
}
};
return pollFn();
}),
}));
jest.mock("@osmosis-labs/utils", () => {
const originalModule = jest.requireActual("@osmosis-labs/utils");
return {
...originalModule,
poll: jest.fn(({ fn, validate }) => {
const pollFn = async () => {
const result = await fn();
if (validate(result)) {
return result;
}
};
return pollFn();
}),
};
});

afterEach(() => {
jest.clearAllMocks();
});

describe("AxelarTransferStatusProvider", () => {
let provider: AxelarTransferStatusProvider;
Expand All @@ -29,10 +37,6 @@ describe("AxelarTransferStatusProvider", () => {
provider.statusReceiverDelegate = mockReceiver;
});

afterEach(() => {
jest.clearAllMocks();
});

it("should initialize with correct URLs", () => {
expect(provider.axelarScanBaseUrl).toBe("https://axelarscan.io");
expect(provider.axelarApiBaseUrl).toBe("https://api.axelarscan.io");
Expand Down

0 comments on commit 6ed3cb1

Please sign in to comment.