From 46cbd6616684519b019c87c946bdf83ffdfbee46 Mon Sep 17 00:00:00 2001 From: DjDeveloperr Date: Sun, 4 Apr 2021 11:22:47 +0530 Subject: [PATCH] move out src/test to test --- .gitignore | 3 ++- mod.ts | 13 ++++++++--- {src/test => test}/chunk.ts | 2 +- {src/test => test}/class.ts | 2 +- {src/test => test}/cmd.ts | 6 ++--- {src/test => test}/cmds/addemoji.ts | 3 +-- {src/test => test}/cmds/eval.ts | 3 +-- {src/test => test}/cmds/join.ts | 3 +-- .../cmds/kickFromSpecificVoice.ts | 9 +++++--- {src/test => test}/cmds/kickFromVoice.ts | 3 +-- {src/test => test}/cmds/leave.ts | 3 +-- {src/test => test}/cmds/mentions.ts | 3 +-- {src/test => test}/cmds/ping.ts | 3 +-- {src/test => test}/cmds/userinfo.ts | 2 +- {src/test => test}/config.ts.sample | 0 {src/test => test}/debug.ts | 10 +++++---- {src/test => test}/guild.ts | 2 +- {src/test => test}/hook.ts | 2 +- {src/test => test}/index.ts | 22 +++++++++---------- {src/test => test}/music.ts | 0 {src/test => test}/slash-http.ts | 0 {src/test => test}/slash-only.ts | 0 {src/test => test}/slash.ts | 0 {src/test => test}/template.ts | 0 test/{mod.ts => unit.ts} | 0 {src/test => test}/user.ts | 2 +- 26 files changed, 51 insertions(+), 45 deletions(-) rename {src/test => test}/chunk.ts (89%) rename {src/test => test}/class.ts (94%) rename {src/test => test}/cmd.ts (97%) rename {src/test => test}/cmds/addemoji.ts (88%) rename {src/test => test}/cmds/eval.ts (82%) rename {src/test => test}/cmds/join.ts (78%) rename {src/test => test}/cmds/kickFromSpecificVoice.ts (81%) rename {src/test => test}/cmds/kickFromVoice.ts (84%) rename {src/test => test}/cmds/leave.ts (79%) rename {src/test => test}/cmds/mentions.ts (89%) rename {src/test => test}/cmds/ping.ts (68%) rename {src/test => test}/cmds/userinfo.ts (89%) rename {src/test => test}/config.ts.sample (100%) rename {src/test => test}/debug.ts (71%) rename {src/test => test}/guild.ts (99%) rename {src/test => test}/hook.ts (83%) rename {src/test => test}/index.ts (96%) rename {src/test => test}/music.ts (100%) rename {src/test => test}/slash-http.ts (100%) rename {src/test => test}/slash-only.ts (100%) rename {src/test => test}/slash.ts (100%) rename {src/test => test}/template.ts (100%) rename test/{mod.ts => unit.ts} (100%) rename {src/test => test}/user.ts (84%) diff --git a/.gitignore b/.gitignore index acbed07..da1c043 100644 --- a/.gitignore +++ b/.gitignore @@ -109,6 +109,7 @@ yarn.lock # PRIVACY XDDDD src/test/config.ts +test/config.ts .vscode # macOS is shit xD @@ -117,4 +118,4 @@ src/test/config.ts # Webstorm dont forget this duude :) .idea/ -src/test/music.mp3 +src/test/music.mp3 \ No newline at end of file diff --git a/mod.ts b/mod.ts index 4ebaf42..fb958fb 100644 --- a/mod.ts +++ b/mod.ts @@ -104,7 +104,15 @@ export type { ClientStatus, StatusType } from './src/types/presence.ts' -export { ChannelTypes } from './src/types/channel.ts' +export { + ChannelTypes, + OverwriteType, + OverrideType +} from './src/types/channel.ts' +export type { + OverwriteAsOptions, + OverwritePayload +} from './src/types/channel.ts' export type { ApplicationPayload } from './src/types/application.ts' export type { ImageFormats, ImageSize } from './src/types/cdn.ts' export type { @@ -129,8 +137,7 @@ export type { MessageStickerPayload, MessageTypes, OverwriteAsArg, - Overwrite, - OverwriteAsOptions + Overwrite } from './src/types/channel.ts' export type { EmojiPayload } from './src/types/emoji.ts' export { Verification } from './src/types/guild.ts' diff --git a/src/test/chunk.ts b/test/chunk.ts similarity index 89% rename from src/test/chunk.ts rename to test/chunk.ts index d1fdbad..39f411d 100644 --- a/src/test/chunk.ts +++ b/test/chunk.ts @@ -1,4 +1,4 @@ -import { Client, Intents } from '../../mod.ts' +import { Client, Intents } from '../mod.ts' import { TOKEN } from './config.ts' const client = new Client() diff --git a/src/test/class.ts b/test/class.ts similarity index 94% rename from src/test/class.ts rename to test/class.ts index e0b87ac..015eafd 100644 --- a/src/test/class.ts +++ b/test/class.ts @@ -6,7 +6,7 @@ import { CommandContext, Extension, CommandBuilder -} from '../../mod.ts' +} from '../mod.ts' import { TOKEN } from './config.ts' class MyClient extends CommandClient { diff --git a/src/test/cmd.ts b/test/cmd.ts similarity index 97% rename from src/test/cmd.ts rename to test/cmd.ts index 4798c36..e33165b 100644 --- a/src/test/cmd.ts +++ b/test/cmd.ts @@ -4,9 +4,9 @@ import { Intents, CommandContext, Extension, - GuildChannels -} from '../../mod.ts' -import { Invite } from '../structures/invite.ts' + GuildChannels, + Invite +} from '../mod.ts' import { TOKEN } from './config.ts' const client = new CommandClient({ diff --git a/src/test/cmds/addemoji.ts b/test/cmds/addemoji.ts similarity index 88% rename from src/test/cmds/addemoji.ts rename to test/cmds/addemoji.ts index c83d7a1..8b4aa6f 100644 --- a/src/test/cmds/addemoji.ts +++ b/test/cmds/addemoji.ts @@ -1,5 +1,4 @@ -import { Command } from '../../../mod.ts' -import { CommandContext } from '../../models/command.ts' +import { Command, CommandContext } from '../../mod.ts' export default class AddEmojiCommand extends Command { name = 'addemoji' diff --git a/src/test/cmds/eval.ts b/test/cmds/eval.ts similarity index 82% rename from src/test/cmds/eval.ts rename to test/cmds/eval.ts index efd46e9..98a391f 100644 --- a/src/test/cmds/eval.ts +++ b/test/cmds/eval.ts @@ -1,5 +1,4 @@ -import { Command } from '../../../mod.ts' -import { CommandContext } from '../../models/command.ts' +import { Command, CommandContext } from '../../mod.ts' export default class EvalCommand extends Command { name = 'eval' diff --git a/src/test/cmds/join.ts b/test/cmds/join.ts similarity index 78% rename from src/test/cmds/join.ts rename to test/cmds/join.ts index 6438d9e..dc19d24 100644 --- a/src/test/cmds/join.ts +++ b/test/cmds/join.ts @@ -1,5 +1,4 @@ -import { Command } from '../../../mod.ts' -import { CommandContext } from '../../models/command.ts' +import { Command, CommandContext } from '../../mod.ts' export default class JoinCommand extends Command { name = 'join' diff --git a/src/test/cmds/kickFromSpecificVoice.ts b/test/cmds/kickFromSpecificVoice.ts similarity index 81% rename from src/test/cmds/kickFromSpecificVoice.ts rename to test/cmds/kickFromSpecificVoice.ts index f60089b..e246bac 100644 --- a/src/test/cmds/kickFromSpecificVoice.ts +++ b/test/cmds/kickFromSpecificVoice.ts @@ -1,6 +1,9 @@ -import { Command, VoiceChannel } from '../../../mod.ts' -import { CommandContext } from '../../models/command.ts' -import { ChannelTypes } from '../../types/channel.ts' +import { + Command, + CommandContext, + ChannelTypes, + VoiceChannel +} from '../../mod.ts' export default class KickFromSpecificVoiceCommand extends Command { name = 'kickFromSpecificVoice' diff --git a/src/test/cmds/kickFromVoice.ts b/test/cmds/kickFromVoice.ts similarity index 84% rename from src/test/cmds/kickFromVoice.ts rename to test/cmds/kickFromVoice.ts index 5730703..6173852 100644 --- a/src/test/cmds/kickFromVoice.ts +++ b/test/cmds/kickFromVoice.ts @@ -1,5 +1,4 @@ -import { Command } from '../../../mod.ts' -import { CommandContext } from '../../models/command.ts' +import { Command, CommandContext } from '../../mod.ts' export default class KickFromVoiceCommand extends Command { name = 'kickFromVoice' diff --git a/src/test/cmds/leave.ts b/test/cmds/leave.ts similarity index 79% rename from src/test/cmds/leave.ts rename to test/cmds/leave.ts index abf5d61..71a1dc2 100644 --- a/src/test/cmds/leave.ts +++ b/test/cmds/leave.ts @@ -1,5 +1,4 @@ -import { Command } from '../../../mod.ts' -import { CommandContext } from '../../models/command.ts' +import { Command, CommandContext } from '../../mod.ts' export default class LeaveCommand extends Command { name = 'leave' diff --git a/src/test/cmds/mentions.ts b/test/cmds/mentions.ts similarity index 89% rename from src/test/cmds/mentions.ts rename to test/cmds/mentions.ts index ce33ee2..44d8d45 100644 --- a/src/test/cmds/mentions.ts +++ b/test/cmds/mentions.ts @@ -1,5 +1,4 @@ -import { Command, Embed } from '../../../mod.ts' -import { CommandContext } from '../../models/command.ts' +import { Command, CommandContext, Embed } from '../../mod.ts' export default class PingCommand extends Command { name = 'mentions' diff --git a/src/test/cmds/ping.ts b/test/cmds/ping.ts similarity index 68% rename from src/test/cmds/ping.ts rename to test/cmds/ping.ts index 3f0c381..852941c 100644 --- a/src/test/cmds/ping.ts +++ b/test/cmds/ping.ts @@ -1,5 +1,4 @@ -import { Command } from '../../../mod.ts' -import { CommandContext } from '../../models/command.ts' +import { Command, CommandContext } from '../../mod.ts' export default class PingCommand extends Command { name = 'ping' diff --git a/src/test/cmds/userinfo.ts b/test/cmds/userinfo.ts similarity index 89% rename from src/test/cmds/userinfo.ts rename to test/cmds/userinfo.ts index 1f1ad60..c172ea8 100644 --- a/src/test/cmds/userinfo.ts +++ b/test/cmds/userinfo.ts @@ -1,4 +1,4 @@ -import { Command, Member, CommandContext, Embed } from '../../../mod.ts' +import { Command, Member, CommandContext, Embed } from '../../mod.ts' export default class UserinfoCommand extends Command { name = 'userinfo' diff --git a/src/test/config.ts.sample b/test/config.ts.sample similarity index 100% rename from src/test/config.ts.sample rename to test/config.ts.sample diff --git a/src/test/debug.ts b/test/debug.ts similarity index 71% rename from src/test/debug.ts rename to test/debug.ts index 48bc55e..c6c690a 100644 --- a/src/test/debug.ts +++ b/test/debug.ts @@ -1,11 +1,11 @@ -import { Client, event } from '../../mod.ts' +import { Client, event } from '../mod.ts' import { TOKEN } from './config.ts' class MyClient extends Client { constructor() { super({ token: TOKEN, - intents: [], + intents: [] }) } @@ -17,7 +17,9 @@ class MyClient extends Client { debug(title: string, msg: string): void { console.log(`[${title}] ${msg}`) if (title === 'Gateway' && msg === 'Initializing WebSocket...') { - try { throw new Error("Stack") } catch (e) { + try { + throw new Error('Stack') + } catch (e) { console.log(e.stack) } } @@ -25,4 +27,4 @@ class MyClient extends Client { } const client = new MyClient() -client.connect() \ No newline at end of file +client.connect() diff --git a/src/test/guild.ts b/test/guild.ts similarity index 99% rename from src/test/guild.ts rename to test/guild.ts index 8c39f9b..df70430 100644 --- a/src/test/guild.ts +++ b/test/guild.ts @@ -5,7 +5,7 @@ import { // PermissionFlags, // ChannelTypes, // GuildCreateOptions -} from '../../mod.ts' +} from '../mod.ts' import { TOKEN } from './config.ts' const client = new Client() diff --git a/src/test/hook.ts b/test/hook.ts similarity index 83% rename from src/test/hook.ts rename to test/hook.ts index 6de3ba5..353c10d 100644 --- a/src/test/hook.ts +++ b/test/hook.ts @@ -1,4 +1,4 @@ -import { Webhook } from '../../mod.ts' +import { Webhook } from '../mod.ts' import { WEBHOOK } from './config.ts' const webhook = await Webhook.fromURL(WEBHOOK) diff --git a/src/test/index.ts b/test/index.ts similarity index 96% rename from src/test/index.ts rename to test/index.ts index 379c695..59afb23 100644 --- a/src/test/index.ts +++ b/test/index.ts @@ -11,11 +11,11 @@ import { ChannelTypes, GuildTextChannel, checkGuildTextBasedChannel, - Permissions -} from '../../mod.ts' -import { Collector } from '../models/collectors.ts' -import { MessageAttachment } from '../structures/message.ts' -import { OverrideType } from '../types/channel.ts' + Permissions, + Collector, + MessageAttachment, + OverrideType +} from '../mod.ts' import { TOKEN } from './config.ts' const client = new Client({ @@ -74,12 +74,12 @@ client.on('messageCreate', async (msg: Message) => { const guilds = await msg.client.guilds.collection() msg.channel.send( 'Guild List:\n' + - (guilds - .array() - .map((c: Guild, i: number) => { - return `${i + 1}. ${c.name} - ${c.memberCount} members` - }) - .join('\n') as string) + (guilds + .array() + .map((c: Guild, i: number) => { + return `${i + 1}. ${c.name} - ${c.memberCount} members` + }) + .join('\n') as string) ) } else if (msg.content === '!roles') { const col = await msg.guild?.roles.collection() diff --git a/src/test/music.ts b/test/music.ts similarity index 100% rename from src/test/music.ts rename to test/music.ts diff --git a/src/test/slash-http.ts b/test/slash-http.ts similarity index 100% rename from src/test/slash-http.ts rename to test/slash-http.ts diff --git a/src/test/slash-only.ts b/test/slash-only.ts similarity index 100% rename from src/test/slash-only.ts rename to test/slash-only.ts diff --git a/src/test/slash.ts b/test/slash.ts similarity index 100% rename from src/test/slash.ts rename to test/slash.ts diff --git a/src/test/template.ts b/test/template.ts similarity index 100% rename from src/test/template.ts rename to test/template.ts diff --git a/test/mod.ts b/test/unit.ts similarity index 100% rename from test/mod.ts rename to test/unit.ts diff --git a/src/test/user.ts b/test/user.ts similarity index 84% rename from src/test/user.ts rename to test/user.ts index cd455ee..1b1a83c 100644 --- a/src/test/user.ts +++ b/test/user.ts @@ -1,4 +1,4 @@ -import { Client, Intents } from '../../mod.ts' +import { Client, Intents } from '../mod.ts' import { TOKEN } from './config.ts' const client = new Client()