initital commit
This commit is contained in:
21
test/server.ts
Normal file
21
test/server.ts
Normal file
@ -0,0 +1,21 @@
|
||||
import mcUtils from "../src/index";
|
||||
import { ServerPlatform } from "../src/types/server/platform";
|
||||
|
||||
test("ensureGetServerLookupSuccess", async () => {
|
||||
const cachedServer = await mcUtils.server.getServer(ServerPlatform.Java, "mc.hypixel.net");
|
||||
const { server } = cachedServer;
|
||||
|
||||
expect(server).toBeDefined();
|
||||
expect(server).toHaveProperty("hostname"); // The server was found
|
||||
});
|
||||
|
||||
test("ensureGetServerIconSuccess", async () => {
|
||||
const icon = await mcUtils.server.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
|
||||
});
|
Reference in New Issue
Block a user