mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-18 01:07:22 +00:00
Merge pull request #1516 from Skillz4Killz/fp-attempt-9001
add discovery tests
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import { Bot } from "../../../src/bot.ts";
|
||||
import { assertEquals } from "../../deps.ts";
|
||||
|
||||
export async function getDiscoveryCategoriesTest(bot: Bot, t: Deno.TestContext) {
|
||||
const categories = await bot.helpers.getDiscoveryCategories();
|
||||
|
||||
assertEquals(categories.size > 0, true);
|
||||
}
|
||||
|
||||
export async function validDiscoveryTermTest(bot: Bot, t: Deno.TestContext) {
|
||||
const valid = await bot.helpers.validDiscoveryTerm("Bots");
|
||||
|
||||
assertEquals(valid, true);
|
||||
}
|
||||
@@ -55,6 +55,7 @@ import { getBanTests } from "./helpers/guilds/getBan.ts";
|
||||
import { getBansTests } from "./helpers/guilds/getBans.ts";
|
||||
import { getGuildTests } from "./helpers/guilds/getGuild.ts";
|
||||
import { getVanityURLTests } from "./helpers/guilds/getVanityUrl.ts";
|
||||
import { getDiscoveryCategoriesTest, validDiscoveryTermTest } from "./helpers/misc/discoveries.ts";
|
||||
|
||||
// CHANGE TO TRUE WHEN DEBUGGING SANITIZATION ERRORS
|
||||
const sanitizeMode = {
|
||||
@@ -783,6 +784,20 @@ Deno.test({
|
||||
},
|
||||
...sanitizeMode,
|
||||
}),
|
||||
t.step({
|
||||
name: "[discovery] Validate a discovery search term",
|
||||
fn: async (t) => {
|
||||
await validDiscoveryTermTest(bot, t);
|
||||
},
|
||||
...sanitizeMode,
|
||||
}),
|
||||
t.step({
|
||||
name: "[discovery] get categories from discovery",
|
||||
fn: async (t) => {
|
||||
await getDiscoveryCategoriesTest(bot, t);
|
||||
},
|
||||
...sanitizeMode,
|
||||
}),
|
||||
// CONDUCT MEMORY BENCHMARK TESTS
|
||||
|
||||
await t.step({
|
||||
|
||||
Reference in New Issue
Block a user