1.0.5 • Published 8 years ago
jest-discord-reporter v1.0.5
Set up
- Set up a Discord incoming webhook integration.
- Add reporter to
package.jsonunderjest.reportersand customize your settings (if you set webhook url usingprocess.env.JEST_DISCORD_WEBHOOKenvironment variable, then none of them are mandatory). If not, then you have to set it inpackage.json.
"jest": {
"reporters": [
"default",
[
"<rootDir>/node_modules/jest-discord-reporter",
{
"sendOnlyWhenFailed": true,
"username": "jest-discord-reporter",
"webhookUrl": "https://discordapp.com/api/webhooks/XXXXXXXXXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}
]
]
}Notes:
- This package uses env-ci module to get some environment variables from CI services.
- While sending the report,
Environmentfield value is taken fromprocess.env.CI_NETWORK, and if it's not present, it's taken fromprocess.env.NETWORK(environment variables). This allows to set this value independently on CI services.