Skip to main content
Version: 1.x


Hooks are functions triggered in different ocassions in corde tests executions All hooks are available bellow:


Use afterAll to execute something that you want to be executed after all tests run. A good example of something to be executed after all tests is the logout of your testing bot.


afterAll(() => {

As corde self make it's bot login, it's make their logout also. So there is no need to worry about it.


Use beforeStart to execute some function before all tests begin.

This can be, for instance, the login of your bot.

beforeStart(async () => {
await bot.login();

In corde tests lifecycle, all these functions are executed after corde login, this bot. Functions to be executed before it will be created future versions of corde.

The image bellow ilustrate the operation of each hook:

Corde hooks lifecycle