corde
    TypeScript icon, indicating that this package has built-in type declarations

    4.4.5 • Public • Published

    😀 Table of Content

    👀 About

    Corde is a small testing library for Discord.js. As there is a tool to create bots for Discord, it's cool to also have a tool to test them. Corde objective is to be simple, fast, and readable to developers.

    Documentation

    The bellow documentation is a resume of what you can find in Corde's site

    🚀 Getting started

    Node.js 14.0 or newer is required

    Starting to create tests with Corde is simple. First, install it locally with npm npm i -D corde or yarn yarn add -D corde.

    After installed, add the file corde.config.json in the root of your application with the following structure:

    {
       "cordeBotToken":  "<tokenForCordeBot>",
       "botTestId":  "<yourBotId>",
       "botToken":  "<yourBotToken>",
       "guildId":  "<guildId>",
       "channelId":  "<channelId>",
       "botPrefix":  "!",
       "testMatches":  ["./test/**"]
    }

    Test example:

    const { group, test, command, beforeStart, afterAll } = require("corde");
    const { client, loginBot } = require("..");
    
    beforeStart(async () => {
      await loginBot();
    });
    
    group("main commands", () => {
      test("ping command must return... Ping?!!", () => {
        expect("ping").toReturn("Ping?");
      });
    });
    
    afterAll(() => {
      client.destroy();
    });

    Install

    npm i corde

    Homepage

    cordejs.org/

    DownloadsWeekly Downloads

    167

    Version

    4.4.5

    License

    MIT

    Unpacked Size

    333 kB

    Total Files

    241

    Last publish

    Collaborators

    • lgmagalhaes88