2024-04-19 19:39:30 +00:00
|
|
|
import {getBlockedStatus, getServer, getServerIcon, ServerPlatform} from "../dist";
|
2024-04-14 20:11:46 +00:00
|
|
|
|
|
|
|
test("ensureGetServerLookupSuccess", async () => {
|
2024-04-17 15:40:02 +00:00
|
|
|
const server = await getServer(ServerPlatform.Java, "mc.hypixel.net");
|
2024-04-14 20:11:46 +00:00
|
|
|
|
|
|
|
expect(server).toBeDefined();
|
|
|
|
expect(server).toHaveProperty("hostname"); // The server was found
|
|
|
|
});
|
|
|
|
|
|
|
|
test("ensureGetServerIconSuccess", async () => {
|
2024-04-15 07:56:26 +00:00
|
|
|
const icon = await getServerIcon("mc.hypixel.net");
|
2024-04-14 20:11:46 +00:00
|
|
|
expect(icon).toBeDefined();
|
|
|
|
expect(icon.byteLength).toBeGreaterThan(0); // The server has an icon
|
|
|
|
});
|
|
|
|
|
|
|
|
test("ensureGetServerBlockedStatusSuccess", async () => {
|
2024-04-15 07:56:26 +00:00
|
|
|
const blockedStatus = await getBlockedStatus("mc.hypixel.net");
|
|
|
|
const { blocked } = blockedStatus;
|
|
|
|
|
|
|
|
expect(blocked).toBe(false); // The server is not blocked
|
2024-04-14 20:11:46 +00:00
|
|
|
});
|