CI additions and tests

This commit is contained in:
Nicholas Keller
2026-01-11 05:19:44 +00:00
parent d661e5b04c
commit ffb8eb5ed1
7 changed files with 260 additions and 79 deletions
+32
View File
@@ -0,0 +1,32 @@
import { expect, test } from "bun:test"
import MCProfile from "./index.js";
test("getPlayerByUsername - Java", async () => {
const profile = await MCProfile.java.getPlayerByUsername("Notch");
expect(profile.username).toBe("Notch");
expect(profile.uuid).toBe("069a79f4-44e9-4726-a5be-fca90e38aaf5");
});
test("getPlayerByUUID - Java", async () => {
const profile = await MCProfile.java.getPlayerByUUID("069a79f4-44e9-4726-a5be-fca90e38aaf5");
expect(profile.username).toBe("Notch");
expect(profile.uuid).toBe("069a79f4-44e9-4726-a5be-fca90e38aaf5");
});
test("getPlayerByGamertag - Bedrock", async () => {
const profile = await MCProfile.bedrock.getPlayerByUsername("Notch");
expect(profile.gamertag).toBe("Notch");
expect(profile.xuid).toBe("2535453759792258");
});
test("getPlayerByXUID - Bedrock", async () => {
const profile = await MCProfile.bedrock.getPlayerByXUID("2535453759792258");
expect(profile.gamertag).toBe("Notch");
expect(profile.xuid).toBe("2535453759792258");
});
test("getPlayerByFUID - Bedrock", async () => {
const profile = await MCProfile.bedrock.getPlayerByFUID("00000000-0000-0000-0009-01fb54b26482");
expect(profile.floodgateuid).toBe("00000000-0000-0000-0009-01fb54b26482");
expect(profile.gamertag).toBe("Notch");
});