This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import mcUtils from "../src/index";
|
||||
import { getMojangEndpointStatus } from "../dist";
|
||||
|
||||
test("ensureMojangEndpointStatusLookupSuccess", async () => {
|
||||
const response = await mcUtils.mojang.getMojangEndpointStatus();
|
||||
const response = await getMojangEndpointStatus();
|
||||
|
||||
expect(response).toHaveProperty("endpoints");
|
||||
});
|
||||
|
@ -1,7 +1,7 @@
|
||||
import mcUtils from "../src/index";
|
||||
import { getPlayer, getPlayerSkinPart, getPlayerUuid } from "../dist/index";
|
||||
|
||||
test("ensureGetPlayerLookupSuccess", async () => {
|
||||
const response = await mcUtils.player.getPlayer("Notch");
|
||||
const response = await getPlayer("Notch");
|
||||
const { player } = response;
|
||||
|
||||
expect(player).toBeDefined();
|
||||
@ -9,7 +9,7 @@ test("ensureGetPlayerLookupSuccess", async () => {
|
||||
});
|
||||
|
||||
test("ensureGetPlayerUuidSuccess", async () => {
|
||||
const player = await mcUtils.player.getPlayerUuid("Notch");
|
||||
const player = await getPlayerUuid("Notch");
|
||||
|
||||
expect(player).toBeDefined();
|
||||
expect(player).toHaveProperty("username");
|
||||
@ -17,7 +17,7 @@ test("ensureGetPlayerUuidSuccess", async () => {
|
||||
});
|
||||
|
||||
test("ensureGetPlayerSkinPartSuccess", async () => {
|
||||
const response = await mcUtils.player.getPlayer("Notch");
|
||||
const response = await getPlayer("Notch");
|
||||
const { player } = response;
|
||||
|
||||
const skin = player.skin;
|
||||
@ -25,7 +25,7 @@ test("ensureGetPlayerSkinPartSuccess", async () => {
|
||||
|
||||
// Test each skin part
|
||||
for (const part in skinParts) {
|
||||
const partBuffer = await mcUtils.player.getPlayerSkinPart(part, player.uniqueId);
|
||||
const partBuffer = await getPlayerSkinPart(part, player.uniqueId);
|
||||
expect(partBuffer).toBeDefined();
|
||||
expect(partBuffer.byteLength).toBeGreaterThan(0);
|
||||
}
|
||||
|
@ -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