Skip to content

Testing

V3L0C1T13S edited this page Dec 5, 2022 · 3 revisions

Testing Reflectcord

Reflectcord comes with tests built into it, powered by Jest. It aims to cover most of the Discord API for accuracy, regressions, and missing endpoints.

Running the tests

Running the test suite is easy. Simply run npm test, or npx jest to get started.

Make sure that you don't build the server though, otherwise the tests will run twice due to Jest automatically detecting the dist folder. In case you already did, simply use npm run clean to delete the build files.

Using on another Discord implementation

Reflectcords tests can also be used on other backend implementations, such as Fosscord. This is beneficial to both the developers of Reflectcord, and other backends, as it helps both parties recognize what API calls are missing or incorrect, and even diagnose errors within the tests themselves.

General advice

If possible, you should run the test suite with Reflectcord configured to use a self-hosted Revolt instance.

This is to avoid causing unnecessary stress on an actual production instance. It's probably fine if you don't, but more preferable if you do.

Clone this wiki locally