Javascript-Library/test/player.ts
Liam db98cf20a1
All checks were successful
Publish Package / build (push) Successful in 19s
fix cache import
2024-04-19 20:39:30 +01:00

31 lines
865 B
TypeScript

import {getPlayer, getPlayerSkinPart, getPlayerUuid} from "../dist/index";
test("ensureGetPlayerLookupSuccess", async () => {
const player = await getPlayer("Notch");
expect(player).toBeDefined();
expect(player).toHaveProperty("username");
});
test("ensureGetPlayerUuidSuccess", async () => {
const player = await getPlayerUuid("Notch");
expect(player).toBeDefined();
expect(player).toHaveProperty("username");
expect(player).toHaveProperty("uniqueId");
});
test("ensureGetPlayerSkinPartSuccess", async () => {
const player = await getPlayer("Notch");
const skin = player.skin;
const skinParts = skin.parts;
// Test each skin part
for (const part in skinParts) {
const partBuffer = await getPlayerSkinPart(part, player.uniqueId);
expect(partBuffer).toBeDefined();
expect(partBuffer.byteLength).toBeGreaterThan(0);
}
});