npm.io
1.1.4 • Published 3 years ago

jest-json-slack

Licence
ISC
Version
1.1.4
Deps
2
Size
19 kB
Vulns
1
Weekly
0

Jest Json Slack Webhook

Integrate your Jest report .json to your Slack webhook.

Installation

To install, use npm:

npm install jest-json-slack

Usage

const sendToSlack = require(jest-json-slack)

const webhookUrl = 'https://yourwebhookurl.com'
const reportLocation = './test-report.json'

(async () => {
  await sendToSlack.postMessage(reportLocation, webhookUrl)
  ...
})();

Use custom message

(async () => {
  await sendToSlack.postMessage(reportLocation, webhookUrl, {
    successMessage: 'Wohoo all the test passed',
    failedMessage: 'So sad there are tests have failed'
  })
  ...
})();

Sample Screenshot

Keywords