add server previews

This commit is contained in:
Lee
2024-04-20 22:49:53 +01:00
parent 436c9be3e5
commit 321db2fb3d
4 changed files with 25 additions and 2 deletions

View File

@ -24,6 +24,7 @@ test("ensureGetPlayerSkinPartSuccess", async () => {
// Test each skin part
for (const part in skinParts) {
const partBuffer = await getPlayerSkinPart(part, player.uniqueId);
expect(partBuffer).toBeDefined();
expect(partBuffer.byteLength).toBeGreaterThan(0);
}

View File

@ -1,4 +1,4 @@
import {getBlockedStatus, getServer, getServerIcon, ServerPlatform} from "../dist";
import {getBlockedStatus, getServer, getServerIcon, getServerPreview, ServerPlatform} from "../dist";
test("ensureGetServerLookupSuccess", async () => {
const server = await getServer(ServerPlatform.Java, "mc.hypixel.net");
@ -9,6 +9,7 @@ test("ensureGetServerLookupSuccess", async () => {
test("ensureGetServerIconSuccess", async () => {
const icon = await getServerIcon("mc.hypixel.net");
expect(icon).toBeDefined();
expect(icon.byteLength).toBeGreaterThan(0); // The server has an icon
});
@ -19,3 +20,10 @@ test("ensureGetServerBlockedStatusSuccess", async () => {
expect(blocked).toBe(false); // The server is not blocked
});
test("ensureGetServerPreviewSuccess", async () => {
const preview = await getServerPreview(ServerPlatform.Java, "mc.hypixel.net");
expect(preview).toBeDefined();
expect(preview.byteLength).toBeGreaterThan(0); // The server has a preview
});