Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cordejs/corde
🤖 A simple e2e library for testing Discord Bots 🚀
https://github.com/cordejs/corde
automated-testing corde discord-bot discordbot discordjs e2e nodejs
Last synced: 18 days ago
JSON representation
🤖 A simple e2e library for testing Discord Bots 🚀
- Host: GitHub
- URL: https://github.com/cordejs/corde
- Owner: cordejs
- License: mit
- Created: 2019-07-30T20:37:08.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-05-19T00:26:40.000Z (over 1 year ago)
- Last Synced: 2024-10-19T06:08:53.081Z (30 days ago)
- Topics: automated-testing, corde, discord-bot, discordbot, discordjs, e2e, nodejs
- Language: TypeScript
- Homepage: https://cordejs.org
- Size: 36.6 MB
- Stars: 122
- Watchers: 2
- Forks: 9
- Open Issues: 27
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
## 😀 Table of Content
- [😀 Table of Content](#-table-of-content)
- [👀 About](#-about)
- [📜 Documentation](#documentation)
- [🚀 Getting started](#-getting-started)## 👀 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](https://cordejs.org)
## 🚀 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:
```javascript
{
"cordeBotToken": "",
"botTestId": "",
"guildId": "",
"channelId": "",
"botPrefix": "!",
"testMatches": ["./test/**"]
}
```Test example:
```javascript
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();
});
```