diff --git a/tests/constants.ts b/tests/constants.ts index 3bfc4abca..1e4afcf94 100644 --- a/tests/constants.ts +++ b/tests/constants.ts @@ -1,4 +1,4 @@ -export const CACHED_COMMUNITY_GUILD_ID = 907350958810480671n; +export const CACHED_COMMUNITY_GUILD_ID = 907350958810480671n; // revert back to 907350958810480671n when testing is finished // CHANGE TO TRUE WHEN DEBUGGING SANITIZATION ERRORS export const sanitizeMode = { @@ -10,4 +10,4 @@ export const sanitizeMode = { // USED FOR ROLE CHANGE EVENTS export const roleChanges = new Map(); -export const banCounters = new Map(); \ No newline at end of file +export const banCounters = new Map(); diff --git a/tests/members/getMembers.ts b/tests/members/getMembers.ts new file mode 100644 index 000000000..2d0c648e2 --- /dev/null +++ b/tests/members/getMembers.ts @@ -0,0 +1,8 @@ +import { bot } from "../mod.ts"; +import { CACHED_COMMUNITY_GUILD_ID } from "../constants.ts"; +import { assertEquals } from "../deps.ts"; + +Deno.test("[member] Gets a member list and checks if the bot is in the member list", async () => { + const members = await bot.helpers.getMembers(CACHED_COMMUNITY_GUILD_ID, { memberCount: 10 }); + assertEquals(members.has(bot.id), true); +}); diff --git a/tests/mod.ts b/tests/mod.ts index 843443b94..5e1e9adfa 100644 --- a/tests/mod.ts +++ b/tests/mod.ts @@ -86,7 +86,7 @@ if (bot.cache.guilds.size() <= 10) { await delayUntil(10000, () => Boolean(startedAt)); // CREATE ONE GUILD SO WE CAN REUSE LATER TO SAVE RATE LIMITS -export const guild = await bot.helpers.createGuild({ name: "Discordeno Test" }); +export const guild = await bot.helpers.getGuild(CACHED_COMMUNITY_GUILD_ID); // Assertions assertExists(guild);