getSupportedChains.test.ts•1.19 kB
import { test, expect, describe } from "bun:test";
import { getSupportedChainsTool } from "../tools/getSupportedChains";
describe("getSupportedChains", () => {
test("should return list of supported chains", async () => {
const result = await getSupportedChainsTool.handler();
expect(result).toBeDefined();
expect(result.chains).toBeDefined();
expect(Array.isArray(result.chains)).toBe(true);
expect(result.totalChains).toBeGreaterThan(0);
console.log("\n✅ getSupportedChains SUCCESS:");
console.log(`Total chains: ${result.totalChains}`);
console.log("Sample chains:");
result.chains.slice(0, 5).forEach((chain: any) => {
console.log(` - ${chain.chainName} (ID: ${chain.chainId})`);
});
}, 30000);
test("should include major blockchains", async () => {
const result = await getSupportedChainsTool.handler();
const chainIds = result.chains.map((c: any) => c.chainId.toString());
expect(chainIds).toContain("1"); // Ethereum
expect(chainIds).toContain("56"); // BSC
expect(chainIds).toContain("137"); // Polygon
expect(chainIds).toContain("42161"); // Arbitrum
}, 30000);
});