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.
module.exports = {
cordeBotToken: "YaA4MDMiOTY2O4I2MjAwODMy.X2iRwg.Rf3-TqLExWuPQjxnVaDCGv9V7cB", // Example value
};
botTestId
- Required:
true
- Type:
string
Your bot's id.
module.exports = {
botTestId: "514212632960122287894", // Example value
};
guildId
- Required:
true
- Type:
string
The id of the guild
where both bots are.
module.exports = {
guildId: "514212632960122287894", // Example value
};
channelId
- Required:
true
- Type:
string
The id of the channel
where both bots are.
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.
module.exports = {
botPrefix: "!", // Example value
};
testMatches
- Required:
true
- Type:
Array<string>
Array with the path of test folders | files.
module.exports = {
testMatches: ["./tests"], // Example value
};
timeout
- Required:
false
- Type:
number
Timeout for each test. The value in milliseconds.
module.exports = {
timeout: 5000, // Default value
};
modulePathIgnorePatterns
- Required:
false
- Type:
string[]
Define the file pattern that corde should ignore.
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
module.exports = {
rootDir: ".", // Example value. It will be resolved by process.cwd()
};
extensions
- Required:
false
- Type:
Array<string>
Define file extensions to be loaded
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.
module.exports = {
exitOnFileReadingError: true, // Default value
};
project
- Required:
false
- Type:
string
Definition of tsconfig path.
module.exports = {
project: "<rootDir>/tsconfig.json", // Default value
};