Javascript-Library/test/server.ts
Liam e4bbc0338f
All checks were successful
Publish Package / build (push) Successful in 1m13s
fix tests part 2
2024-04-17 16:40:02 +01:00

22 lines
754 B
TypeScript

import { ServerPlatform, getBlockedStatus, getServer, getServerIcon } from "../dist";
test("ensureGetServerLookupSuccess", async () => {
const server = await getServer(ServerPlatform.Java, "mc.hypixel.net");
expect(server).toBeDefined();
expect(server).toHaveProperty("hostname"); // The server was found
});
test("ensureGetServerIconSuccess", async () => {
const icon = await getServerIcon("mc.hypixel.net");
expect(icon).toBeDefined();
expect(icon.byteLength).toBeGreaterThan(0); // The server has an icon
});
test("ensureGetServerBlockedStatusSuccess", async () => {
const blockedStatus = await getBlockedStatus("mc.hypixel.net");
const { blocked } = blockedStatus;
expect(blocked).toBe(false); // The server is not blocked
});