Skip to main content
Version: 1.x


When testing functionalities with an bot, expect will let you define what a bot should do given a command passed to it. All tests current available in this version(2.0) are listed bellow:


All examples bellow are only to ilustrate the functions called after command. These examples are not used exatly show they are described in a real use case.



Expect is a function that receives a command as argument. The same argument that you would send to Discord to invoke some action from your bot. As there is a prefix witch can be passed in config file, there is no need to pass that prefix in command function.


Suposing that there is a bot with prefix ! and that bot has a command called createAGuild, you can use command like the example bellow:


This function returns a several other functions to define what Corde should check after that command be invoke.


If for some reason you what to pass the bot prefix in command, do not use the config variable prefix.


Use not to deny some test after this keyword. It can be used to check if a operation made by a bot command is anything but not something.


test("command hello should not return 1", () => {

mustAddReaction(string | string[])

Use mustAddReaction to check if the bot added an reaction or an list of reactions to the last message sent by someone who is not a bot.


Given a bot who has a command called addReactions and add the reactions ๐Ÿ˜„ and ๐ŸŠ, you can write a test like:

test("bot should return Hello!!", () => {
command("addReactions").mustAddReaction("๐Ÿ˜„", "๐ŸŠ");