Skip to content

merges together two inspector-format coverage reports

License

Notifications You must be signed in to change notification settings

bcoe/v8-coverage-merge

Repository files navigation

v8-coverage-merge

Build Status Conventional Commits Coverage Status

Merges together the V8 inspector format JSON output for duplicate scripts:

const merge = require('v8-coverage-merge')
const merged = merge(
  {
    scriptId: '70',
    url: '/Users/benjamincoe/oss/c8/test/fixtures/timeout.js',
    functions: [
      {
        functionName: 'bar',
        isBlockCoverage: true,
        ranges: [
          {
            startOffset: 30,
            endOffset: 221,
            count: 1
          }
        ]
      }
    ]
  },
  {
    scriptId: '71',
    url: '/Users/benjamincoe/oss/c8/test/fixtures/timeout.js',
    functions: [
      {
        functionName: 'foo',
        isBlockCoverage: true,
        ranges: [
          {
            startOffset: 70,
            endOffset: 400,
            count: 2
          }
        ]
      }
    ]
  }
)

Merging is necessary if coverage is output from multiple subprocesses.

About

merges together two inspector-format coverage reports

Resources

License

Stars

Watchers

Forks

Packages

No packages published