Git Product home page Git Product logo

coverage-slackify's Introduction

Coverage Slackify

The coverage-slackify package allows you to effortlessly integrate code coverage summaries and build details into your Slack workflow. It simplifies the process of notifying your team about the health of your project's test coverage.

Table of Contents

  1. ๐Ÿš€ Features
  2. ๐Ÿ”ง Installation
  3. ๐Ÿ“‹ Prerequisites
  4. ๐Ÿ›  Usage
    1. Via npm Task
    2. Defining SLACK_WEBHOOK Environment Variable
  5. ๐Ÿ”ง Custom Configuration
  6. ๐Ÿค Contributing
  7. ๐Ÿ“„ License

๐Ÿš€ Features

  • Easily incorporate code coverage summaries and build details into your Slack channels.
  • Define pass/fail thresholds for project coverage to keep your team informed about the state of your tests.
  • Works smoothly with popular CI/CD platforms like Jenkins, Travis CI, and GitHub Actions.
  • Handles scenarios where Git is not enabled or the Slack webhook is not provided with ease.
  • Customize default settings through package.json for a tailored integration.

๐Ÿ”ง Installation

You can install coverage-slackify via npm or yarn:

npm install --save-dev coverage-slackify
# or
yarn add -D coverage-slackify

๐Ÿ“‹ Prerequisites

Before using coverage-slackify, make sure you have the following:

  • A Slack webhook URL from your Slack workspace.
  • Istanbul or Jest coverage report can be generated for your project.

๐Ÿ›  Usage

Via npm Task

If you prefer using npm tasks, you can include coverage-slackify as part of your testing workflow:

"scripts": {
  "test": "jest --coverage",
  "test:ci": "npm test && coverage-slackify"
}

Then, you can run the task in your CI/CD pipeline:

SLACK_WEBHOOK=$SLACK_WEBHOOK npm run test:ci

Defining SLACK_WEBHOOK Environment Variable

You can also define the Slack webhook directly as an environment variable:

"scripts": {
  "test": "jest --coverage",
  "test:ci": "npm test && SLACK_WEBHOOK=https://hooks.slack.com/xxxxx coverage-slackify"
}

Note: Be cautious about exposing your Slack webhook URL in public repositories.

๐Ÿ”ง Custom Configuration

You can override default configurations by adding a coverageSlackify section in your package.json:

"coverageSlackify": {
  "threshold": 80,
  "projectName": "Coverage Slackify",
  "coverageFiles": [
    "coverage/coverage-final.json"
  ]
}

๐Ÿค Contributing

Contributions are welcome! If you have any ideas, enhancements, or bug fixes, feel free to open an issue or create a pull request.

๐Ÿ“„ License

This project is licensed under the MIT License. See the LICENSE file for details.

coverage-slackify's People

Contributors

devdbrandy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.