mirror of
https://github.com/sern-handler/handler
synced 2026-06-06 01:16:55 +00:00
feat: remove unit testing
This commit is contained in:
@@ -1,28 +1,5 @@
|
||||
import type { Message } from 'discord.js';
|
||||
|
||||
/**
|
||||
* Checks if the author of message is a bot or not
|
||||
* @param message The message to check
|
||||
* @returns `true` if the author of the message is a bot, `false` otherwise
|
||||
* @example
|
||||
* isBot(message) ? 'yes it is a bot' : 'no it is not a bot';
|
||||
*/
|
||||
export function isNotFromBot(message: Message) {
|
||||
return !message.author.bot;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the message **starts** with the prefix
|
||||
* @param message The message to check
|
||||
* @param prefix The prefix to check for
|
||||
* @returns `true` if the message starts with the prefix, `false` otherwise
|
||||
* @example
|
||||
* hasPrefix(message, '!') ? 'yes it does' : 'no it does not';
|
||||
*/
|
||||
export function hasPrefix(message: Message, prefix?: string) {
|
||||
return message.content.startsWith(prefix!);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the first character(s) _[depending on prefix length]_ of the message
|
||||
* @param msg
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
import { fmt, hasPrefix, isNotFromBot } from '../src/handler/utilities/messageHelpers';
|
||||
|
||||
describe('FUNCTIONS', () => {
|
||||
test('If hasPrefix is a function', () => {
|
||||
expect(typeof hasPrefix).toBe('function');
|
||||
});
|
||||
test('if fmt is a function', () => {
|
||||
expect(typeof fmt).toBe('function');
|
||||
});
|
||||
test('if isBot is a function', () => {
|
||||
expect(typeof isNotFromBot).toBe('function');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user