This commit is contained in:
@ -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
|
||||
});
|
||||
|
Reference in New Issue
Block a user