mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 19:28:17 +00:00
add test
This commit is contained in:
@@ -0,0 +1,29 @@
|
|||||||
|
import { defaultTestOptions, tempData } from "../ws/start_bot.ts";
|
||||||
|
import { assertEquals, assertExists } from "../deps.ts";
|
||||||
|
import { searchMembers } from "../../src/helpers/members/search_members.ts";
|
||||||
|
import { botId, cache } from "../../mod.ts";
|
||||||
|
|
||||||
|
async function ifItFailsBlameWolf() {
|
||||||
|
const botMember = cache.members.get(botId);
|
||||||
|
|
||||||
|
// Assertions
|
||||||
|
assertExists(botMember);
|
||||||
|
|
||||||
|
const foundMembers = await searchMembers(
|
||||||
|
tempData.guildId,
|
||||||
|
botMember!.username.substring(0, 4),
|
||||||
|
{
|
||||||
|
limit: 1,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
assertEquals(foundMembers.size, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
Deno.test({
|
||||||
|
name: "[members] search guild members",
|
||||||
|
async fn() {
|
||||||
|
await ifItFailsBlameWolf();
|
||||||
|
},
|
||||||
|
...defaultTestOptions,
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user