cleanup
Some checks failed
Publish Package / build (push) Has been cancelled

This commit is contained in:
Lee
2024-04-15 08:56:26 +01:00
parent 3342f696af
commit b9d79659c8
12 changed files with 150 additions and 219 deletions

View File

@ -1,8 +1,8 @@
import mcUtils from "../src/index";
import { getBlockedStatus, getServer, getServerIcon } from "../dist";
import { ServerPlatform } from "../src/types/server/platform";
test("ensureGetServerLookupSuccess", async () => {
const cachedServer = await mcUtils.server.getServer(ServerPlatform.Java, "mc.hypixel.net");
const cachedServer = await getServer(ServerPlatform.Java, "mc.hypixel.net");
const { server } = cachedServer;
expect(server).toBeDefined();
@ -10,12 +10,14 @@ test("ensureGetServerLookupSuccess", async () => {
});
test("ensureGetServerIconSuccess", async () => {
const icon = await mcUtils.server.getServerIcon("mc.hypixel.net");
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 mcUtils.server.getBlockedStatus("mc.hypixel.net");
expect(blockedStatus).toBe(false); // The server is not blocked
const blockedStatus = await getBlockedStatus("mc.hypixel.net");
const { blocked } = blockedStatus;
expect(blocked).toBe(false); // The server is not blocked
});