New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

shieldgen

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shieldgen

Update your package readme on every test with build status and code coverage

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

shieldgen

Update your package readme on every test with build status and code coverage.

(Because paying >1k a month for badges on private projects would be silly)

Installation

Only supported with Jest.

  • Install as dev dependency:
npm i -D shieldgen
  • Set to run after jest in package.json
"scripts": {
  "test": "jest --json --outputFile coverage/testResults.json && shieldgen"
},
  • Enable code coverage in jest.config.js:
module.exports = {
  // ...
  collectCoverage: true,
  coverageReporters: ["html"]
};

Configuration

Configuration for badge colors and messages, as well as optional Airtable integration is specified in .shieldgen.config.json. For integration, AIRTABLE_API_KEY must be set as an environment variable.

Here is an example configuration.

{
  "readmePath": "readme.md",

  "testing": {
    "label": "build",
    "testStatusPath": "coverage/testResults.json",
    "pass": {
      "message": "passed",
      "color": "brightgreen"
    },
    "fail": {
      "message": "failed",
      "color": "red"
    }
  },

  "coverage": {
    "label": "coverage",
    "coveragePath": "coverage/index.html",
    "zeroCoverageColor": "ee4444",
    "fullCoverageColor": "22dd22"
  },

  "airtableIntegration": {
    "baseId": "appbHzsS9UBTiFabc",
    "tableName": "Repos",
    "nameColumn": "Name",
    "testStatusColumn": "Test Status",
    "coverageColumn": "Coverage"
  }
}

Keywords

coverage

FAQs

Package last updated on 06 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts