initital commit
This commit is contained in:
32
test/player.ts
Normal file
32
test/player.ts
Normal file
@ -0,0 +1,32 @@
|
||||
import mcUtils from "../src/index";
|
||||
|
||||
test("ensureGetPlayerLookupSuccess", async () => {
|
||||
const response = await mcUtils.player.getPlayer("Notch");
|
||||
const { player } = response;
|
||||
|
||||
expect(player).toBeDefined();
|
||||
expect(player).toHaveProperty("username");
|
||||
});
|
||||
|
||||
test("ensureGetPlayerUuidSuccess", async () => {
|
||||
const player = await mcUtils.player.getPlayerUuid("Notch");
|
||||
|
||||
expect(player).toBeDefined();
|
||||
expect(player).toHaveProperty("username");
|
||||
expect(player).toHaveProperty("uniqueId");
|
||||
});
|
||||
|
||||
test("ensureGetPlayerSkinPartSuccess", async () => {
|
||||
const response = await mcUtils.player.getPlayer("Notch");
|
||||
const { player } = response;
|
||||
|
||||
const skin = player.skin;
|
||||
const skinParts = skin.parts;
|
||||
|
||||
// Test each skin part
|
||||
for (const part in skinParts) {
|
||||
const partBuffer = await mcUtils.player.getPlayerSkinPart(part, player.uniqueId);
|
||||
expect(partBuffer).toBeDefined();
|
||||
expect(partBuffer.byteLength).toBeGreaterThan(0);
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user