Skip to content

Commit

Permalink
refactor: dynamic test
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiralite committed Dec 18, 2023
1 parent 1f5d71e commit eb9b366
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions packages/discord.js/typings/index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ import {
Emoji,
PartialEmoji,
Awaitable,
Channel,
DirectoryChannel,
} from '.';
import { expectAssignable, expectNotAssignable, expectNotType, expectType } from 'tsd';
Expand Down Expand Up @@ -2283,22 +2284,12 @@ declare const anyComponentsActionRowComp: ActionRow<ActionRowComponent>;
expectType<ActionRowBuilder>(ActionRowBuilder.from(anyComponentsActionRowData));
expectType<ActionRowBuilder>(ActionRowBuilder.from(anyComponentsActionRowComp));

declare const partialGroupDMChannel: PartialGroupDMChannel;
declare const stageChannel: StageChannel;
declare const directoryChannel: DirectoryChannel;
declare const mediaChannel: MediaChannel;

expectType<ChannelMention>(textChannel.toString());
expectType<UserMention>(dmChannel.toString());
expectType<ChannelMention>(voiceChannel.toString());
expectType<ChannelMention>(partialGroupDMChannel.toString());
expectType<ChannelMention>(categoryChannel.toString());
expectType<ChannelMention>(newsChannel.toString());
expectType<ChannelMention>(threadChannel.toString());
expectType<ChannelMention>(stageChannel.toString());
expectType<ChannelMention>(directoryChannel.toString());
expectType<ChannelMention>(forumChannel.toString());
expectType<ChannelMention>(mediaChannel.toString());
type UserMentionChannels = DMChannel | PartialDMChannel;
declare const channelMentionChannels: Exclude<Channel | DirectoryChannel, UserMentionChannels>;
declare const userMentionChannels: UserMentionChannels;

expectType<ChannelMention>(channelMentionChannels.toString());
expectType<UserMention>(userMentionChannels.toString());
expectType<UserMention>(user.toString());
expectType<UserMention>(guildMember.toString());

Expand All @@ -2320,7 +2311,9 @@ expectType<Promise<Message>>(interactionWebhook.send('content'));
expectType<Promise<Message>>(interactionWebhook.editMessage(snowflake, 'content'));
expectType<Promise<Message>>(interactionWebhook.fetchMessage(snowflake));

declare const partialGroupDMChannel: PartialGroupDMChannel;
declare const categoryChannel: CategoryChannel;
declare const stageChannel: StageChannel;
declare const forumChannel: ForumChannel;

await forumChannel.edit({
Expand Down

0 comments on commit eb9b366

Please sign in to comment.