mirror of
https://github.com/DeBrosOfficial/network-ts-sdk.git
synced 2025-12-11 01:58:49 +00:00
31 lines
922 B
TypeScript
31 lines
922 B
TypeScript
import { describe, it, expect, beforeAll } from "vitest";
|
|
import { createTestClient, skipIfNoGateway } from "./setup";
|
|
|
|
describe("Network", () => {
|
|
beforeAll(() => {
|
|
if (skipIfNoGateway()) {
|
|
console.log("Skipping network tests");
|
|
}
|
|
});
|
|
|
|
it("should check health", async () => {
|
|
const client = await createTestClient();
|
|
const healthy = await client.network.health();
|
|
expect(typeof healthy).toBe("boolean");
|
|
});
|
|
|
|
it("should get network status", async () => {
|
|
const client = await createTestClient();
|
|
const status = await client.network.status();
|
|
expect(status).toBeDefined();
|
|
expect(typeof status.connected).toBe("boolean");
|
|
expect(typeof status.peer_count).toBe("number");
|
|
});
|
|
|
|
it("should list peers", async () => {
|
|
const client = await createTestClient();
|
|
const peers = await client.network.peers();
|
|
expect(Array.isArray(peers)).toBe(true);
|
|
});
|
|
});
|