--- id: configurations title: Configurations custom_edit_url: https://github.com/cordejs/corde/blob/master/docs/Configuration.mdx --- Corde's configuration can be defined through a `corde.config.js|json|ts|cjs` 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](CLI.mdx#--config). Configs can also be accessed (in readonly mode) trough `corde.configs`. :::note `cordeBotToken` can be found in [Discord Developers portal](https://discord.com/developers/applications) ::: ## Configuration Options ### `cordeBotToken` - Required: `true` - Type: `string` The bot token that Corde will use to simulate a user. ```js title="corde.config.js" module.exports = { cordeBotToken: "YaA4MDMiOTY2O4I2MjAwODMy.X2iRwg.Rf3-TqLExWuPQjxnVaDCGv9V7cB", // Example value }; ``` --- ### `botTestId` - Required: `true` - Type: `string` Your bot's id. ```js title="corde.config.js" module.exports = { botTestId: "514212632960122287894", // Example value }; ``` --- ### `guildId` - Required: `true` - Type: `string` The id of the `guild` where both bots are. ```js title="corde.config.js" module.exports = { guildId: "514212632960122287894", // Example value }; ``` --- ### `channelId` - Required: `true` - Type: `string` The id of the `channel` where both bots are. ```js title="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. ```js title="corde.config.js" module.exports = { botPrefix: "!", // Example value }; ``` --- ### `testMatches` - Required: `true` - Type: `Array` Array with the path of test folders | files. ```js title="corde.config.js" module.exports = { testMatches: ["./tests"], // Example value }; ``` --- ### `timeout` - Required: `false` - Type: `number` Timeout for each test. The value in milliseconds. ```js title="corde.config.js" module.exports = { timeout: 5000, // Default value }; ``` --- ### `modulePathIgnorePatterns` - Required: `false` - Type: `string[]` Define the file pattern that corde should ignore. ```js title="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` ::: ```js title="corde.config.js" module.exports = { rootDir: ".", // Example value. It will be resolved by process.cwd() }; ``` --- ### `extensions` - Required: `false` - Type: `Array` Define file extensions to be loaded ```js title="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. ```js title="corde.config.js" module.exports = { exitOnFileReadingError: true, // Default value }; ``` --- ### `project` - Required: `false` - Type: `string` Definition of tsconfig path. ```js title="corde.config.js" module.exports = { project: "/tsconfig.json", // Default value }; ```