Skip to main content
Version: 4.x

Configurations

Corde's configuration can be defined through a corde.config.js|json|ts file. This file must be at the root of your application, or you can declare a custom path for it with the cli option --config.

Configs can also be accessed (in readonly mode) trough corde.configs.

note

cordeBotToken can be found in Discord Developers portal

Configuration Options

cordeBotToken

  • Required: true
  • Type: string

The bot token that Corde will use to simulate a user.

corde.config.js
module.exports = {
cordeBotToken: "YaA4MDMiOTY2O4I2MjAwODMy.X2iRwg.Rf3-TqLExWuPQjxnVaDCGv9V7cB", // Example value
};

botTestId

  • Required: true
  • Type: string

Your bot's id.

corde.config.js
module.exports = {
botTestId: "514212632960122287894", // Example value
};

guildId

  • Required: true
  • Type: string

The id of the guild where both bots are.

corde.config.js
module.exports = {
guildId: "514212632960122287894", // Example value
};

channelId

  • Required: true
  • Type: string

The id of the channel where both bots are.

corde.config.js
module.exports = {
channelId: "514212632960122287894", // Example value
};

botPrefix

  • Required: true
  • Type: string

Prefix for call your bot. This value is attached to each command sent by corde.

corde.config.js
module.exports = {
botPrefix: "!", // Example value
};

testMatches

  • Required: true
  • Type: Array<string>

Array with the path of test folders | files.

corde.config.js
module.exports = {
testMatches: ["./tests"], // Example value
};

timeout

  • Required: false
  • Type: number

Timeout for each test. The value in milliseconds.

corde.config.js
module.exports = {
timeout: 5000, // Default value
};

modulePathIgnorePatterns

  • Required: false
  • Type: string[]

Define the file pattern that corde should ignore.

corde.config.js
module.exports = {
modulePathIgnorePatterns: ["**/tests/*.fixture.js"], // Example value
};

rootDir

  • Required: false
  • Type: string[]

Defines root dir of the project.

note

Default value uses process.cwd() to pick the rootDir

corde.config.js
module.exports = {
rootDir: ".", // Example value. It will be resolved by process.cwd()
};

extensions

  • Required: false
  • Type: Array<string>

Define file extensions to be loaded

corde.config.js
module.exports = {
extensions: [".js", ".ts"], // Default value
};

exitOnFileReadingError

  • Required: false
  • Type: boolean

Define if corde should stop if any problem occour when importing a test file.

corde.config.js
module.exports = {
exitOnFileReadingError: true, // Default value
};

project

  • Required: false
  • Type: string

Definition of tsconfig path.

corde.config.js
module.exports = {
project: "<rootDir>/tsconfig.json", // Default value
};