Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@connectis/coverage-merger

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@connectis/coverage-merger

Library for merging parsed coverage reports.

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

coverage-merger

A Node.js library for merging parsed coverage reports.

NPM versionDependency Status

This library makes it possible to merge parsed coverage results. The following parsers are supported:

Example

const coverageMerger = require('@connectis/coverage-merger');
const mergedResults = coverageMerger.mergeByFile(coverageResults);

API

The API includes the following:

  • mergeByFile(coverageResults)
  • mergeBy(coverageResults, grouper)
  • merge(coverageResults)

mergeByFile(coverageResults)

Merges coverage results which have the same value for the file property.

coverageResults

Type: Array<CoverageResult. See below.

returns

Type: Array<CoverageResult. See below.

mergeBy(coverageResults, grouper)

Merges coverage results for which the grouper iteratee returns the same string See _.groupBy.

coverageResults

Type: Array<CoverageResult. See below.

grouper

Type: (CoverageResult) => String. See below.

returns

Type: Array<CoverageResult. See below.

merge(coverageResults)

Merges an array of coverage results to a single result.

coverageResults

Type: Array<CoverageResult. See below.

returns

Type: CoverageResult. See below.

CoverageResult

The returned data has the following format.

{
  "title": "Test #1",
  "file": "/some/absolute/path/anim-base/anim-base-coverage.js",
  "functions": {
    "hit": 23,
    "found": 29,
    "details": [
      {
        "name": "(anonymous 1)",
        "line": 7,
        "hit": 6
      },
      {
        "name": "(anonymous 2)",
        "line": 620,
        "hit": 225
      },
      {
        "name": "_end",
        "line": 516,
        "hit": 228
      }
    ]
  },
  "lines": {
    "found": 181,
    "hit": 143,
    "details": [
      {
        "line": 7,
        "hit": 6
      },
      {
        "line": 29,
        "hit": 6
      },
      {
        "line": 41,
        "hit": 0
      }
    ]
  },
  "branches": {
    "found": 2,
    "hit": 1,
    "details": [
      {
        "line": 9,
        "branch": 0,
        "taken": 0
      },
      {
        "line": 9,
        "branch": 1,
        "taken": 1
      }
    ]
  }
}

Keywords

FAQs

Package last updated on 02 Nov 2018

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc